nodal icon indicating copy to clipboard operation
nodal copied to clipboard

addColumn in a migration does not take "unique" into account

Open sylvainlap opened this issue 8 years ago • 1 comments

Hi,

I created a table thanks to a first migration.

up() {
    return [
      this.createTable('tags', []),
    ];
  }

Then I tried to add a unique field to that table thanks to a second migration.

up() {
    return [
      this.addColumn('tags', 'text', 'string', { nullable: false, unique: true }),
    ];
  }

However, after the nodal db:migrate, the UNIQUE constraint is not present in my table.

capture

sylvainlap avatar Jul 13 '16 09:07 sylvainlap

Thanks for bringing this to my attention. I'll look into this for 0.13.

keithwhor avatar Jul 18 '16 07:07 keithwhor