Skip to content

sync does not create tables on PostgreSQL #71

Description

sync(function(err) { /*...*/ } in release 2.0.4 does neither produce an error nor create the underlying tables. Reproducable by this snippet on PostgreSQL 9.0:

var orm = require('orm'),
    config = require('../config');

orm.connect('postgresql://' +
    config.database.username + ':' + config.database.password +
    '@' + config.database.host + '/' + config.database.name,
    function(err, db) {
        if(err) console.error(err);

        var Test = db.define('test', {
            val1: String,
            val2: Number,
            val3: Boolean,
            val4: [ 'A', 'B', 'C' ],
            val5: Buffer
        });

        Test.sync(function(err) {
            if(err) console.error(err);
            else console.log('Test synced');
        })

        db.sync(function(err) {
            if(err) console.error(err);
            else console.log('Database synced');
        });
    }
);

Output:

Test synced
Database synced

The database exists and the user does have the rights to access it and create tables.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions