diff options
Diffstat (limited to 'add_some_data.pl')
| -rwxr-xr-x | add_some_data.pl | 9 |
1 files changed, 4 insertions, 5 deletions
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; |
