mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Fixed error when setting Oracle column to not null (#8111)
* Fixed error when setting Oracle column to not null * Normalized migrations for all vendors * Downgraded knex version * Updated knex again * Update 20210907A-webhooks-collections-not-null.ts * Update 20210920A-webhooks-url-not-null.ts Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
This commit is contained in:
@@ -117,7 +117,7 @@
|
||||
"json2csv": "^5.0.3",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"keyv": "^4.0.3",
|
||||
"knex": "^0.95.6",
|
||||
"knex": "^0.95.11",
|
||||
"knex-schema-inspector": "1.6.1",
|
||||
"liquidjs": "^9.25.0",
|
||||
"lodash": "^4.17.21",
|
||||
|
||||
@@ -28,6 +28,6 @@ export async function down(knex: Knex): Promise<void> {
|
||||
}
|
||||
|
||||
await knex.schema.alterTable('directus_webhooks', (table) => {
|
||||
table.string('url').alter();
|
||||
table.string('url').notNullable().alter();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,6 +28,6 @@ export async function down(knex: Knex): Promise<void> {
|
||||
}
|
||||
|
||||
await knex.schema.alterTable('directus_webhooks', (table) => {
|
||||
table.string('collections').alter();
|
||||
table.string('collections').notNullable().alter();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,12 +1,26 @@
|
||||
import { Knex } from 'knex';
|
||||
// @ts-ignore
|
||||
import Client_Oracledb from 'knex/lib/dialects/oracledb';
|
||||
|
||||
export async function up(knex: Knex): Promise<void> {
|
||||
if (knex.client instanceof Client_Oracledb) {
|
||||
/* Oracle is already not nullable due to an oversight in
|
||||
"20210312A-webhooks-collections-text.ts" */
|
||||
return;
|
||||
}
|
||||
|
||||
await knex.schema.alterTable('directus_webhooks', (table) => {
|
||||
table.text('collections').notNullable().alter();
|
||||
});
|
||||
}
|
||||
|
||||
export async function down(knex: Knex): Promise<void> {
|
||||
if (knex.client instanceof Client_Oracledb) {
|
||||
/* Oracle is already not nullable due to an oversight in
|
||||
"20210312A-webhooks-collections-text.ts" */
|
||||
return;
|
||||
}
|
||||
|
||||
await knex.schema.alterTable('directus_webhooks', (table) => {
|
||||
table.text('collections').alter();
|
||||
});
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import { Knex } from 'knex';
|
||||
// @ts-ignore
|
||||
import Client_Oracledb from 'knex/lib/dialects/oracledb';
|
||||
|
||||
export async function up(knex: Knex): Promise<void> {
|
||||
if (knex.client instanceof Client_Oracledb) {
|
||||
/* Oracle is already not nullable due to an oversight in
|
||||
"20201105B-change-webhook-url-type.ts" */
|
||||
return;
|
||||
}
|
||||
|
||||
await knex.schema.alterTable('directus_webhooks', (table) => {
|
||||
table.text('url').notNullable().alter();
|
||||
});
|
||||
}
|
||||
|
||||
export async function down(knex: Knex): Promise<void> {
|
||||
if (knex.client instanceof Client_Oracledb) {
|
||||
/* Oracle is already not nullable due to an oversight in
|
||||
"20201105B-change-webhook-url-type.ts" */
|
||||
return;
|
||||
}
|
||||
|
||||
await knex.schema.alterTable('directus_webhooks', (table) => {
|
||||
table.text('url').alter();
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user