We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bda982d commit b95a9b0Copy full SHA for b95a9b0
source/migrations/20210122184357_users_index.ts
@@ -0,0 +1,15 @@
1
+import * as Knex from 'knex';
2
+
3
+export async function up(knex: Knex): Promise<void> {
4
+ knex.schema.alterTable('users', function (t) {
5
+ t.unique(['user_id']);
6
+ t.index(['user_id', 'lang']);
7
+ });
8
+}
9
10
+export async function down(knex: Knex): Promise<void> {
11
12
+ t.dropUnique(['user_id']);
13
+ t.dropIndex(['user_id', 'lang']);
14
15
0 commit comments