feat: Make key field primary key for app config model
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
export async function up(knex) {
|
||||||
|
return knex.schema.alterTable('app_configs', function (table) {
|
||||||
|
table.dropPrimary();
|
||||||
|
table.primary('key');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function down(knex) {
|
||||||
|
return knex.schema.alterTable('app_configs', function (table) {
|
||||||
|
table.dropPrimary();
|
||||||
|
table.primary('id');
|
||||||
|
});
|
||||||
|
}
|
@@ -5,6 +5,10 @@ import Base from './base.js';
|
|||||||
class AppConfig extends Base {
|
class AppConfig extends Base {
|
||||||
static tableName = 'app_configs';
|
static tableName = 'app_configs';
|
||||||
|
|
||||||
|
static get idColumn() {
|
||||||
|
return 'key';
|
||||||
|
}
|
||||||
|
|
||||||
static jsonSchema = {
|
static jsonSchema = {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['key'],
|
required: ['key'],
|
||||||
|
Reference in New Issue
Block a user