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 {
|
||||
static tableName = 'app_configs';
|
||||
|
||||
static get idColumn() {
|
||||
return 'key';
|
||||
}
|
||||
|
||||
static jsonSchema = {
|
||||
type: 'object',
|
||||
required: ['key'],
|
||||
|
Reference in New Issue
Block a user