fea(providers): locking postgres (#9545)

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
This commit is contained in:
Carlos R. L. Rodrigues
2024-10-17 10:11:39 -03:00
committed by GitHub
parent 3b50c6d019
commit e9a06f4b4d
18 changed files with 641 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
{
"namespaces": [
"public"
],
"name": "public",
"tables": [
{
"columns": {
"id": {
"name": "id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"owner_id": {
"name": "owner_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"expiration": {
"name": "expiration",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
}
},
"name": "locking",
"schema": "public",
"indexes": [
{
"keyName": "locking_pkey",
"columnNames": [
"id"
],
"composite": false,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {}
}
]
}

View File

@@ -0,0 +1,13 @@
import { Migration } from "@mikro-orm/migrations"
export class Migration20241009222919_InitialSetupMigration extends Migration {
async up(): Promise<void> {
this.addSql(
'create table if not exists "locking" ("id" text not null, "owner_id" text null, "expiration" timestamptz null, constraint "locking_pkey" primary key ("id"));'
)
}
async down(): Promise<void> {
this.addSql(`drop table "locking";`)
}
}