Skip to content

Commit

Permalink
Add unit test for renaming column in postgresql
Browse files Browse the repository at this point in the history
  • Loading branch information
izri16 committed Jun 4, 2017
1 parent 31ba04a commit fde91d3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/unit/schema/postgres.js
Expand Up @@ -245,6 +245,14 @@ describe("PostgreSQL SchemaBuilder", function() {
expect(tableSql[0].sql).to.equal('alter table "users" rename to "foo"');
});

it("rename column", function() {
tableSql = client.schemaBuilder().table('users', function(table) {
table.renameColumn('username', 'login');
}).toSQL();
equal(1, tableSql.length);
expect(tableSql[0].sql).to.equal('alter table "users" rename "username" to "login"');
});

it("adding primary key", function() {
tableSql = client.schemaBuilder().table('users', function(table) {
table.primary('foo');
Expand Down

0 comments on commit fde91d3

Please sign in to comment.