~ubuntu-branches/ubuntu/utopic/apgdiff/utopic-proposed

« back to all changes in this revision

Viewing changes to src/main/java/cz/startnet/utils/pgdiff/parsers/CreateTableParser.java

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Berg
  • Date: 2010-10-11 09:08:18 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20101011090818-s0bzw1ieg6rmpfld
Tags: 2.2.2-1
* New upstream version.
* Using changelog included in zipfile, thanks Miroslav for providing this.
* Update manpage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 */
6
6
package cz.startnet.utils.pgdiff.parsers;
7
7
 
 
8
import cz.startnet.utils.pgdiff.Resources;
8
9
import cz.startnet.utils.pgdiff.schema.PgColumn;
9
10
import cz.startnet.utils.pgdiff.schema.PgConstraint;
10
11
import cz.startnet.utils.pgdiff.schema.PgDatabase;
11
12
import cz.startnet.utils.pgdiff.schema.PgSchema;
12
13
import cz.startnet.utils.pgdiff.schema.PgTable;
 
14
import java.text.MessageFormat;
13
15
 
14
16
/**
15
17
 * Parses CREATE TABLE statements.
42
44
        final PgSchema schema = database.getSchema(schemaName);
43
45
 
44
46
        if (schema == null) {
45
 
            throw new RuntimeException(
46
 
                    "Cannot get schema '" + schemaName
47
 
                    + "'. Need to issue 'CREATE SCHEMA " + schemaName
48
 
                    + ";' before 'CREATE TABLE " + tableName + "...;'?");
 
47
            throw new RuntimeException(MessageFormat.format(
 
48
                    Resources.getString("CannotFindSchemaCreateTable"),
 
49
                    schemaName, tableName));
49
50
        }
50
51
 
51
52
        schema.addTable(table);