adminizer 4.4.0-build.164 → 4.4.0-build.166
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -139,17 +139,20 @@ export async function up(knex) {
|
|
|
139
139
|
table.timestamp("createdAt", { useTz: false }).notNullable().defaultTo(defaultTimestamp);
|
|
140
140
|
table.timestamp("updatedAt", { useTz: false }).notNullable().defaultTo(defaultTimestamp);
|
|
141
141
|
});
|
|
142
|
-
// M:N join: GroupAP <-> UserAP via "
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
142
|
+
// M:N join: GroupAP <-> UserAP via "groupap_users__userap_groups"
|
|
143
|
+
// Waterline naming convention: {model1}_{collection1}__{model2}_{collection2}
|
|
144
|
+
// GroupAP.users -> UserAP.groups => groupap_users__userap_groups
|
|
145
|
+
// Column naming: {model}_{collection} references the TARGET model
|
|
146
|
+
await knex.schema.createTable("groupap_users__userap_groups", (table) => {
|
|
147
|
+
table.increments("id").primary().notNullable();
|
|
148
|
+
table.integer("groupap_users").notNullable().references("id").inTable("groupap");
|
|
149
|
+
table.integer("userap_groups").notNullable().references("id").inTable("userap");
|
|
146
150
|
table.timestamp("createdAt", { useTz: false }).notNullable().defaultTo(defaultTimestamp);
|
|
147
151
|
table.timestamp("updatedAt", { useTz: false }).notNullable().defaultTo(defaultTimestamp);
|
|
148
|
-
table.primary(["UserAPId", "GroupAPId"]);
|
|
149
152
|
});
|
|
150
153
|
}
|
|
151
154
|
export async function down(knex) {
|
|
152
|
-
await knex.schema.dropTableIfExists("
|
|
155
|
+
await knex.schema.dropTableIfExists("groupap_users__userap_groups");
|
|
153
156
|
await knex.schema.dropTableIfExists("usernotificationap");
|
|
154
157
|
await knex.schema.dropTableIfExists("mediamanagermetaap");
|
|
155
158
|
await knex.schema.dropTableIfExists("mediamanagerassociationsap");
|