From 00c7f6129f87d77788aa92e08dd77b7b473f9a71 Mon Sep 17 00:00:00 2001 From: yo mama Date: Mon, 23 Mar 2015 15:57:09 -0700 Subject: moved things around --- add_some_data.pl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'add_some_data.pl') diff --git a/add_some_data.pl b/add_some_data.pl index 3362d11..01c574b 100755 --- a/add_some_data.pl +++ b/add_some_data.pl @@ -23,15 +23,16 @@ my $entry3 = { date => DateTime->now()->epoch, }; #our $schema = JournalApp::Schema->connect( 'dbi:SQLite:./journals.db', '', ''); -our $schema = JournalApp::Schema->connect( 'dbi:mysql:database=journal;host=localhost;port=3306', 'journal_user', 'journal_password', { +our $schema = JournalApp::Schema->connect( 'dbi:mysql:database=journal;host=localhost;port=3306', + 'journal_user', + 'journal_password', { quote_names => 1 }); sub test_remove_from_db{ #delete by id my $journalentry = $schema->resultset('Journal')->find({ id => $entry->{id} }); - -$journalentry->delete(); + $journalentry->delete(); } @@ -59,8 +60,6 @@ sub test_add_journal_entry{ return $journalentry; } -#how do I connect? - sub main{ test_add_journal_entry $entry1; test_add_journal_entry $entry2; -- cgit v1.2.3-70-g09d2