tethys.backend/database/migrations/config_1_appconfigs_table.ts
Arno Kaimbacher 2c4f51be68
Some checks failed
CI Pipeline / japa-tests (push) Failing after 51s
feat: Enhance reference validation and add support for Handle URLs
- Updated reference validation to handle various identifier types including DOI, ISBN, ISSN, URN, and Handle.
- Improved regex patterns for DOI and Handle validation to correctly extract and validate identifiers from URLs.
- Added asynchronous checks to verify the existence of DOI and Handle URLs.
- Added asynchronous checks to verify the existence of  ISBNs
- Included detailed comments explaining the regex patterns and validation logic.
- Adjusted the validation logic to handle any URL prefix for Handle identifiers.
- Ensured that the Handle format `handle/20.500.12854/36478` is correctly validated.
- Updated the CI workflow to trigger on push and pull request events.
2025-01-24 17:11:10 +01:00

22 lines
693 B
TypeScript

// node ace make:migration appconfig
import { BaseSchema } from '@adonisjs/lucid/schema';
export default class extends BaseSchema {
protected tableName = 'appconfigs';
async up() {
this.schema.createTable(this.tableName, (table) => {
table.increments('id');
table.string('appid', 32).notNullable();
table.string('configkey', 64).notNullable();
table.text('configvalue');
table.bigInteger('type');
table.smallint('lazy');
table.unique(['appid', 'configkey']) // Unique constraint on the combination
});
}
async down() {
this.schema.dropTable(this.tableName);
}
}