sso-core/migrations/meta/0000_snapshot.json
2024-06-01 14:42:08 +03:00

985 lines
25 KiB
JSON

{
"id": "00000000-0000-0000-0000-000000000000",
"prevId": "",
"version": "5",
"dialect": "mysql",
"tables": {
"audit_log": {
"name": "audit_log",
"columns": {
"id": {
"autoincrement": true,
"name": "id",
"type": "int(11)",
"primaryKey": false,
"notNull": true
},
"action": {
"autoincrement": false,
"name": "action",
"type": "text",
"primaryKey": false,
"notNull": true
},
"content": {
"default": "'NULL'",
"autoincrement": false,
"name": "content",
"type": "text",
"primaryKey": false,
"notNull": false
},
"actor_ip": {
"default": "'NULL'",
"autoincrement": false,
"name": "actor_ip",
"type": "text",
"primaryKey": false,
"notNull": false
},
"actor_ua": {
"default": "'NULL'",
"autoincrement": false,
"name": "actor_ua",
"type": "text",
"primaryKey": false,
"notNull": false
},
"flagged": {
"default": 0,
"autoincrement": false,
"name": "flagged",
"type": "tinyint",
"primaryKey": false,
"notNull": true
},
"created_at": {
"default": "'current_timestamp(6)'",
"autoincrement": false,
"name": "created_at",
"type": "datetime(6)",
"primaryKey": false,
"notNull": true
},
"actorId": {
"default": "'NULL'",
"autoincrement": false,
"name": "actorId",
"type": "int(11)",
"primaryKey": false,
"notNull": false
}
},
"compositePrimaryKeys": {},
"indexes": {},
"foreignKeys": {
"FK_cb6aa6f6fd56f08eafb60316225": {
"name": "FK_cb6aa6f6fd56f08eafb60316225",
"tableFrom": "audit_log",
"tableTo": "user",
"columnsFrom": [
"actorId"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"uniqueConstraints": {}
},
"document": {
"name": "document",
"columns": {
"id": {
"autoincrement": true,
"name": "id",
"type": "int(11)",
"primaryKey": false,
"notNull": true
},
"title": {
"autoincrement": false,
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"slug": {
"autoincrement": false,
"name": "slug",
"type": "text",
"primaryKey": false,
"notNull": true
},
"body": {
"autoincrement": false,
"name": "body",
"type": "text",
"primaryKey": false,
"notNull": true
},
"authorId": {
"default": "'NULL'",
"autoincrement": false,
"name": "authorId",
"type": "int(11)",
"primaryKey": false,
"notNull": false
},
"created_at": {
"default": "'current_timestamp(6)'",
"autoincrement": false,
"name": "created_at",
"type": "datetime(6)",
"primaryKey": false,
"notNull": true
},
"updated_at": {
"default": "'current_timestamp(6)'",
"autoincrement": false,
"name": "updated_at",
"type": "datetime(6)",
"primaryKey": false,
"notNull": true
}
},
"compositePrimaryKeys": {},
"indexes": {},
"foreignKeys": {
"FK_6a2eb13cadfc503989cbe367572": {
"name": "FK_6a2eb13cadfc503989cbe367572",
"tableFrom": "document",
"tableTo": "user",
"columnsFrom": [
"authorId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"uniqueConstraints": {}
},
"migrations": {
"name": "migrations",
"columns": {
"id": {
"autoincrement": true,
"name": "id",
"type": "int(11)",
"primaryKey": false,
"notNull": true
},
"timestamp": {
"autoincrement": false,
"name": "timestamp",
"type": "bigint(20)",
"primaryKey": false,
"notNull": true
},
"name": {
"autoincrement": false,
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
}
},
"compositePrimaryKeys": {},
"indexes": {},
"foreignKeys": {},
"uniqueConstraints": {}
},
"o_auth2_client": {
"name": "o_auth2_client",
"columns": {
"id": {
"autoincrement": true,
"name": "id",
"type": "int(11)",
"primaryKey": false,
"notNull": true
},
"client_id": {
"autoincrement": false,
"name": "client_id",
"type": "varchar(36)",
"primaryKey": false,
"notNull": true
},
"client_secret": {
"autoincrement": false,
"name": "client_secret",
"type": "text",
"primaryKey": false,
"notNull": true
},
"title": {
"autoincrement": false,
"name": "title",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"description": {
"default": "'NULL'",
"autoincrement": false,
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"scope": {
"default": "'NULL'",
"autoincrement": false,
"name": "scope",
"type": "text",
"primaryKey": false,
"notNull": false
},
"grants": {
"default": "''authorization_code''",
"autoincrement": false,
"name": "grants",
"type": "text",
"primaryKey": false,
"notNull": true
},
"activated": {
"default": 0,
"autoincrement": false,
"name": "activated",
"type": "tinyint",
"primaryKey": false,
"notNull": true
},
"verified": {
"default": 0,
"autoincrement": false,
"name": "verified",
"type": "tinyint",
"primaryKey": false,
"notNull": true
},
"pictureId": {
"default": "'NULL'",
"autoincrement": false,
"name": "pictureId",
"type": "int(11)",
"primaryKey": false,
"notNull": false
},
"ownerId": {
"default": "'NULL'",
"autoincrement": false,
"name": "ownerId",
"type": "int(11)",
"primaryKey": false,
"notNull": false
},
"created_at": {
"default": "'current_timestamp(6)'",
"autoincrement": false,
"name": "created_at",
"type": "datetime(6)",
"primaryKey": false,
"notNull": true
},
"updated_at": {
"default": "'current_timestamp(6)'",
"autoincrement": false,
"name": "updated_at",
"type": "datetime(6)",
"primaryKey": false,
"notNull": true
}
},
"compositePrimaryKeys": {},
"indexes": {},
"foreignKeys": {
"FK_4a6c878506b872e85b3d07f6252": {
"name": "FK_4a6c878506b872e85b3d07f6252",
"tableFrom": "o_auth2_client",
"tableTo": "user",
"columnsFrom": [
"ownerId"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"FK_e8d65b1eec13474e493420517d7": {
"name": "FK_e8d65b1eec13474e493420517d7",
"tableFrom": "o_auth2_client",
"tableTo": "upload",
"columnsFrom": [
"pictureId"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"uniqueConstraints": {
"IDX_e9d16c213910ad57bd05e97b42": {
"name": "IDX_e9d16c213910ad57bd05e97b42",
"columns": [
"client_id"
]
}
}
},
"o_auth2_client_authorization": {
"name": "o_auth2_client_authorization",
"columns": {
"id": {
"autoincrement": true,
"name": "id",
"type": "int(11)",
"primaryKey": false,
"notNull": true
},
"scope": {
"default": "'NULL'",
"autoincrement": false,
"name": "scope",
"type": "text",
"primaryKey": false,
"notNull": false
},
"expires_at": {
"default": "'current_timestamp()'",
"autoincrement": false,
"name": "expires_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"clientId": {
"default": "'NULL'",
"autoincrement": false,
"name": "clientId",
"type": "int(11)",
"primaryKey": false,
"notNull": false
},
"userId": {
"default": "'NULL'",
"autoincrement": false,
"name": "userId",
"type": "int(11)",
"primaryKey": false,
"notNull": false
},
"created_at": {
"default": "'current_timestamp(6)'",
"autoincrement": false,
"name": "created_at",
"type": "datetime(6)",
"primaryKey": false,
"notNull": true
}
},
"compositePrimaryKeys": {},
"indexes": {},
"foreignKeys": {
"FK_8227110f58510b7233f3db90cfb": {
"name": "FK_8227110f58510b7233f3db90cfb",
"tableFrom": "o_auth2_client_authorization",
"tableTo": "user",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"FK_9ca9ebb654e7ce71954d5fdb281": {
"name": "FK_9ca9ebb654e7ce71954d5fdb281",
"tableFrom": "o_auth2_client_authorization",
"tableTo": "o_auth2_client",
"columnsFrom": [
"clientId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"uniqueConstraints": {}
},
"o_auth2_client_url": {
"name": "o_auth2_client_url",
"columns": {
"id": {
"autoincrement": true,
"name": "id",
"type": "int(11)",
"primaryKey": false,
"notNull": true
},
"url": {
"autoincrement": false,
"name": "url",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"type": {
"autoincrement": false,
"name": "type",
"type": "enum('redirect_uri','terms','privacy','website')",
"primaryKey": false,
"notNull": true
},
"created_at": {
"default": "'current_timestamp(6)'",
"autoincrement": false,
"name": "created_at",
"type": "timestamp(6)",
"primaryKey": false,
"notNull": true
},
"updated_at": {
"default": "'current_timestamp(6)'",
"autoincrement": false,
"name": "updated_at",
"type": "timestamp(6)",
"primaryKey": false,
"notNull": true
},
"clientId": {
"default": "'NULL'",
"autoincrement": false,
"name": "clientId",
"type": "int(11)",
"primaryKey": false,
"notNull": false
}
},
"compositePrimaryKeys": {},
"indexes": {},
"foreignKeys": {
"FK_aca59c7bdd65987487eea98d00f": {
"name": "FK_aca59c7bdd65987487eea98d00f",
"tableFrom": "o_auth2_client_url",
"tableTo": "o_auth2_client",
"columnsFrom": [
"clientId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"uniqueConstraints": {}
},
"o_auth2_token": {
"name": "o_auth2_token",
"columns": {
"id": {
"autoincrement": true,
"name": "id",
"type": "int(11)",
"primaryKey": false,
"notNull": true
},
"type": {
"autoincrement": false,
"name": "type",
"type": "enum('code','access_token','refresh_token')",
"primaryKey": false,
"notNull": true
},
"token": {
"autoincrement": false,
"name": "token",
"type": "text",
"primaryKey": false,
"notNull": true
},
"scope": {
"default": "'NULL'",
"autoincrement": false,
"name": "scope",
"type": "text",
"primaryKey": false,
"notNull": false
},
"expires_at": {
"default": "'current_timestamp()'",
"autoincrement": false,
"name": "expires_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"userId": {
"default": "'NULL'",
"autoincrement": false,
"name": "userId",
"type": "int(11)",
"primaryKey": false,
"notNull": false
},
"clientId": {
"default": "'NULL'",
"autoincrement": false,
"name": "clientId",
"type": "int(11)",
"primaryKey": false,
"notNull": false
},
"nonce": {
"default": "'NULL'",
"autoincrement": false,
"name": "nonce",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"default": "'current_timestamp(6)'",
"autoincrement": false,
"name": "created_at",
"type": "datetime(6)",
"primaryKey": false,
"notNull": true
},
"updated_at": {
"default": "'current_timestamp(6)'",
"autoincrement": false,
"name": "updated_at",
"type": "datetime(6)",
"primaryKey": false,
"notNull": true
},
"pcke": {
"default": "'NULL'",
"autoincrement": false,
"name": "pcke",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"compositePrimaryKeys": {},
"indexes": {},
"foreignKeys": {
"FK_3ecb760b321ef9bbab635f05b45": {
"name": "FK_3ecb760b321ef9bbab635f05b45",
"tableFrom": "o_auth2_token",
"tableTo": "o_auth2_client",
"columnsFrom": [
"clientId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"FK_81ffb9b8d672cf3af1af9e789f3": {
"name": "FK_81ffb9b8d672cf3af1af9e789f3",
"tableFrom": "o_auth2_token",
"tableTo": "user",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"uniqueConstraints": {}
},
"privilege": {
"name": "privilege",
"columns": {
"id": {
"autoincrement": true,
"name": "id",
"type": "int(11)",
"primaryKey": false,
"notNull": true
},
"name": {
"autoincrement": false,
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"compositePrimaryKeys": {},
"indexes": {},
"foreignKeys": {},
"uniqueConstraints": {}
},
"upload": {
"name": "upload",
"columns": {
"id": {
"autoincrement": true,
"name": "id",
"type": "int(11)",
"primaryKey": false,
"notNull": true
},
"original_name": {
"autoincrement": false,
"name": "original_name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"mimetype": {
"autoincrement": false,
"name": "mimetype",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"file": {
"autoincrement": false,
"name": "file",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"uploaderId": {
"default": "'NULL'",
"autoincrement": false,
"name": "uploaderId",
"type": "int(11)",
"primaryKey": false,
"notNull": false
},
"created_at": {
"default": "'current_timestamp(6)'",
"autoincrement": false,
"name": "created_at",
"type": "datetime(6)",
"primaryKey": false,
"notNull": true
},
"updated_at": {
"default": "'current_timestamp(6)'",
"autoincrement": false,
"name": "updated_at",
"type": "datetime(6)",
"primaryKey": false,
"notNull": true
}
},
"compositePrimaryKeys": {},
"indexes": {},
"foreignKeys": {
"FK_7b8d52838a953b188255682597b": {
"name": "FK_7b8d52838a953b188255682597b",
"tableFrom": "upload",
"tableTo": "user",
"columnsFrom": [
"uploaderId"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "cascade"
}
},
"uniqueConstraints": {}
},
"user": {
"name": "user",
"columns": {
"id": {
"autoincrement": true,
"name": "id",
"type": "int(11)",
"primaryKey": false,
"notNull": true
},
"uuid": {
"autoincrement": false,
"name": "uuid",
"type": "varchar(36)",
"primaryKey": false,
"notNull": true
},
"username": {
"autoincrement": false,
"name": "username",
"type": "varchar(26)",
"primaryKey": false,
"notNull": true
},
"email": {
"autoincrement": false,
"name": "email",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"display_name": {
"autoincrement": false,
"name": "display_name",
"type": "varchar(32)",
"primaryKey": false,
"notNull": true
},
"password": {
"default": "'NULL'",
"autoincrement": false,
"name": "password",
"type": "text",
"primaryKey": false,
"notNull": false
},
"activated": {
"default": 0,
"autoincrement": false,
"name": "activated",
"type": "tinyint",
"primaryKey": false,
"notNull": true
},
"activity_at": {
"default": "'current_timestamp()'",
"autoincrement": false,
"name": "activity_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"pictureId": {
"default": "'NULL'",
"autoincrement": false,
"name": "pictureId",
"type": "int(11)",
"primaryKey": false,
"notNull": false
},
"created_at": {
"default": "'current_timestamp(6)'",
"autoincrement": false,
"name": "created_at",
"type": "datetime(6)",
"primaryKey": false,
"notNull": true
},
"updated_at": {
"default": "'current_timestamp(6)'",
"autoincrement": false,
"name": "updated_at",
"type": "datetime(6)",
"primaryKey": false,
"notNull": true
}
},
"compositePrimaryKeys": {},
"indexes": {},
"foreignKeys": {
"FK_7478a15985dbfa32ed5fc77a7a1": {
"name": "FK_7478a15985dbfa32ed5fc77a7a1",
"tableFrom": "user",
"tableTo": "upload",
"columnsFrom": [
"pictureId"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "cascade"
}
},
"uniqueConstraints": {
"IDX_a95e949168be7b7ece1a2382fe": {
"name": "IDX_a95e949168be7b7ece1a2382fe",
"columns": [
"uuid"
]
},
"IDX_78a916df40e02a9deb1c4b75ed": {
"name": "IDX_78a916df40e02a9deb1c4b75ed",
"columns": [
"username"
]
},
"IDX_e12875dfb3b1d92d7d7c5377e2": {
"name": "IDX_e12875dfb3b1d92d7d7c5377e2",
"columns": [
"email"
]
}
}
},
"user_privileges_privilege": {
"name": "user_privileges_privilege",
"columns": {
"userId": {
"autoincrement": false,
"name": "userId",
"type": "int(11)",
"primaryKey": false,
"notNull": true
},
"privilegeId": {
"autoincrement": false,
"name": "privilegeId",
"type": "int(11)",
"primaryKey": false,
"notNull": true
}
},
"compositePrimaryKeys": {},
"indexes": {
"IDX_0664a7ff494a1859a09014c0f1": {
"name": "IDX_0664a7ff494a1859a09014c0f1",
"columns": [
"userId"
],
"isUnique": false
},
"IDX_e71171f4ed20bc8564a1819d0b": {
"name": "IDX_e71171f4ed20bc8564a1819d0b",
"columns": [
"privilegeId"
],
"isUnique": false
}
},
"foreignKeys": {
"FK_0664a7ff494a1859a09014c0f17": {
"name": "FK_0664a7ff494a1859a09014c0f17",
"tableFrom": "user_privileges_privilege",
"tableTo": "user",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "cascade"
},
"FK_e71171f4ed20bc8564a1819d0b7": {
"name": "FK_e71171f4ed20bc8564a1819d0b7",
"tableFrom": "user_privileges_privilege",
"tableTo": "privilege",
"columnsFrom": [
"privilegeId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "cascade"
}
},
"uniqueConstraints": {}
},
"user_token": {
"name": "user_token",
"columns": {
"id": {
"autoincrement": true,
"name": "id",
"type": "int(11)",
"primaryKey": false,
"notNull": true
},
"token": {
"autoincrement": false,
"name": "token",
"type": "text",
"primaryKey": false,
"notNull": true
},
"type": {
"autoincrement": false,
"name": "type",
"type": "enum('generic','activation','deactivation','password','login','gdpr','totp','public_key','recovery')",
"primaryKey": false,
"notNull": true
},
"expires_at": {
"default": "'NULL'",
"autoincrement": false,
"name": "expires_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"userId": {
"default": "'NULL'",
"autoincrement": false,
"name": "userId",
"type": "int(11)",
"primaryKey": false,
"notNull": false
},
"nonce": {
"default": "'NULL'",
"autoincrement": false,
"name": "nonce",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"default": "'current_timestamp(6)'",
"autoincrement": false,
"name": "created_at",
"type": "datetime(6)",
"primaryKey": false,
"notNull": true
}
},
"compositePrimaryKeys": {},
"indexes": {},
"foreignKeys": {
"FK_d37db50eecdf9b8ce4eedd2f918": {
"name": "FK_d37db50eecdf9b8ce4eedd2f918",
"tableFrom": "user_token",
"tableTo": "user",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"uniqueConstraints": {}
}
},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"tables": {}
}
}