implemented a lot of features
This commit is contained in:
1 parent
62f1767df3
commit
bcb9be5da9
141 files changed
+10705
-385
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import { BaseSchema } from '@adonisjs/lucid/schema'
|
||||
|
||||
/**
|
||||
* par2 set id per listed file (traceability; see LOG.md 2026-09-28 for the
|
||||
* cross-post merges it helps diagnose), and a stricter "random name" rule:
|
||||
* long letter-only tokens with many capitals count as random too
|
||||
* (e.g. RmISakytFwXSCEzjVEpaKk).
|
||||
*/
|
||||
export default class extends BaseSchema {
|
||||
async up() {
|
||||
this.schema.alterTable('release_files', (table) => {
|
||||
table.string('set_id', 32)
|
||||
})
|
||||
this.defer(async (db) => {
|
||||
await db.rawQuery(`
|
||||
CREATE OR REPLACE FUNCTION is_readable_name(name text) RETURNS boolean IMMUTABLE LANGUAGE sql AS $$
|
||||
SELECT name IS NOT NULL AND NOT (
|
||||
(name_stem(name) ~ '^[A-Za-z0-9]{16,}$' AND name_stem(name) ~ '[a-z]' AND name_stem(name) ~ '[A-Z]'
|
||||
AND (name_stem(name) ~ '\\d' OR length(regexp_replace(name_stem(name), '[^A-Z]', '', 'g')) >= 6))
|
||||
OR name_stem(name) ~* '^[0-9a-f]{16,}$')
|
||||
$$`)
|
||||
})
|
||||
}
|
||||
|
||||
async down() {
|
||||
this.schema.alterTable('release_files', (table) => table.dropColumn('set_id'))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user