Skip to content

Commit

Permalink
Don't spawn db if already spawned.
Browse files Browse the repository at this point in the history
  • Loading branch information
mateu committed Aug 1, 2009
1 parent a1ea25d commit 4d46f42
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions script/mojomojo_spawn_db.pl
Expand Up @@ -84,6 +84,13 @@

my $schema = MojoMojo::Schema->connect($dsn, $user, $pass) or
die "Failed to connect to database";

# Check if database is already deployed by
# examining if the table Person exists and has a record.
eval { $schema->resultset('MojoMojo::Schema::Result::Person')->count };
if (!$@ ) {
die "You have already deployed your database\n";
}

print <<"EOF";
Expand Down

0 comments on commit 4d46f42

Please sign in to comment.