forked from BRETT/BRETT
647 lines
16 KiB
JSON
647 lines
16 KiB
JSON
{
|
|
"version": "5",
|
|
"dialect": "mysql",
|
|
"id": "31523494-9f1f-4a98-a7fd-d89eb6c6dcb9",
|
|
"prevId": "c07cfc65-aada-4595-a8d1-4736c858c104",
|
|
"tables": {
|
|
"comments": {
|
|
"name": "comments",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "bigint unsigned",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": true
|
|
},
|
|
"upload_id": {
|
|
"name": "upload_id",
|
|
"type": "varchar(8)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "bigint unsigned",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"content": {
|
|
"name": "content",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false,
|
|
"default": "(now())"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"comments_upload_id_uploads_id_fk": {
|
|
"name": "comments_upload_id_uploads_id_fk",
|
|
"tableFrom": "comments",
|
|
"tableTo": "uploads",
|
|
"columnsFrom": [
|
|
"upload_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"comments_user_id_users_id_fk": {
|
|
"name": "comments_user_id_users_id_fk",
|
|
"tableFrom": "comments",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {
|
|
"comments_id": {
|
|
"name": "comments_id",
|
|
"columns": [
|
|
"id"
|
|
]
|
|
}
|
|
},
|
|
"uniqueConstraints": {},
|
|
"checkConstraint": {}
|
|
},
|
|
"favorites": {
|
|
"name": "favorites",
|
|
"columns": {
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "bigint unsigned",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"upload_id": {
|
|
"name": "upload_id",
|
|
"type": "varchar(8)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false,
|
|
"default": "(now())"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"favorites_user_id_users_id_fk": {
|
|
"name": "favorites_user_id_users_id_fk",
|
|
"tableFrom": "favorites",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"favorites_upload_id_uploads_id_fk": {
|
|
"name": "favorites_upload_id_uploads_id_fk",
|
|
"tableFrom": "favorites",
|
|
"tableTo": "uploads",
|
|
"columnsFrom": [
|
|
"upload_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {
|
|
"favorites_user_id_upload_id_pk": {
|
|
"name": "favorites_user_id_upload_id_pk",
|
|
"columns": [
|
|
"user_id",
|
|
"upload_id"
|
|
]
|
|
}
|
|
},
|
|
"uniqueConstraints": {},
|
|
"checkConstraint": {}
|
|
},
|
|
"notifications": {
|
|
"name": "notifications",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "bigint unsigned",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "bigint unsigned",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"actor_id": {
|
|
"name": "actor_id",
|
|
"type": "bigint unsigned",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"upload_id": {
|
|
"name": "upload_id",
|
|
"type": "varchar(8)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"comment_id": {
|
|
"name": "comment_id",
|
|
"type": "bigint unsigned",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"is_read": {
|
|
"name": "is_read",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false,
|
|
"default": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false,
|
|
"default": "(now())"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"notifications_user_id_users_id_fk": {
|
|
"name": "notifications_user_id_users_id_fk",
|
|
"tableFrom": "notifications",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"notifications_actor_id_users_id_fk": {
|
|
"name": "notifications_actor_id_users_id_fk",
|
|
"tableFrom": "notifications",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"actor_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"notifications_upload_id_uploads_id_fk": {
|
|
"name": "notifications_upload_id_uploads_id_fk",
|
|
"tableFrom": "notifications",
|
|
"tableTo": "uploads",
|
|
"columnsFrom": [
|
|
"upload_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"notifications_comment_id_comments_id_fk": {
|
|
"name": "notifications_comment_id_comments_id_fk",
|
|
"tableFrom": "notifications",
|
|
"tableTo": "comments",
|
|
"columnsFrom": [
|
|
"comment_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {
|
|
"notifications_id": {
|
|
"name": "notifications_id",
|
|
"columns": [
|
|
"id"
|
|
]
|
|
}
|
|
},
|
|
"uniqueConstraints": {},
|
|
"checkConstraint": {}
|
|
},
|
|
"roles": {
|
|
"name": "roles",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "bigint unsigned",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "varchar(50)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false,
|
|
"default": "(now())"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {
|
|
"roles_id": {
|
|
"name": "roles_id",
|
|
"columns": [
|
|
"id"
|
|
]
|
|
}
|
|
},
|
|
"uniqueConstraints": {
|
|
"roles_name_unique": {
|
|
"name": "roles_name_unique",
|
|
"columns": [
|
|
"name"
|
|
]
|
|
}
|
|
},
|
|
"checkConstraint": {}
|
|
},
|
|
"sessions": {
|
|
"name": "sessions",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "bigint unsigned",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false,
|
|
"default": "(now())"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"sessions_user_id_users_id_fk": {
|
|
"name": "sessions_user_id_users_id_fk",
|
|
"tableFrom": "sessions",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {
|
|
"sessions_id": {
|
|
"name": "sessions_id",
|
|
"columns": [
|
|
"id"
|
|
]
|
|
}
|
|
},
|
|
"uniqueConstraints": {},
|
|
"checkConstraint": {}
|
|
},
|
|
"uploads": {
|
|
"name": "uploads",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "varchar(8)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "bigint unsigned",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"type": {
|
|
"name": "type",
|
|
"type": "enum('image','video','youtube','link')",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"file_name": {
|
|
"name": "file_name",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
},
|
|
"external_url": {
|
|
"name": "external_url",
|
|
"type": "varchar(2048)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
},
|
|
"original_name": {
|
|
"name": "original_name",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"mime_type": {
|
|
"name": "mime_type",
|
|
"type": "varchar(100)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
},
|
|
"size": {
|
|
"name": "size",
|
|
"type": "bigint unsigned",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
},
|
|
"preview_image": {
|
|
"name": "preview_image",
|
|
"type": "varchar(2048)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
},
|
|
"preview_title": {
|
|
"name": "preview_title",
|
|
"type": "varchar(500)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false,
|
|
"default": "(now())"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"uploads_user_id_users_id_fk": {
|
|
"name": "uploads_user_id_users_id_fk",
|
|
"tableFrom": "uploads",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {
|
|
"uploads_id": {
|
|
"name": "uploads_id",
|
|
"columns": [
|
|
"id"
|
|
]
|
|
}
|
|
},
|
|
"uniqueConstraints": {},
|
|
"checkConstraint": {}
|
|
},
|
|
"user_roles": {
|
|
"name": "user_roles",
|
|
"columns": {
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "bigint unsigned",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"role_id": {
|
|
"name": "role_id",
|
|
"type": "bigint unsigned",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"user_roles_user_id_users_id_fk": {
|
|
"name": "user_roles_user_id_users_id_fk",
|
|
"tableFrom": "user_roles",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"user_roles_role_id_roles_id_fk": {
|
|
"name": "user_roles_role_id_roles_id_fk",
|
|
"tableFrom": "user_roles",
|
|
"tableTo": "roles",
|
|
"columnsFrom": [
|
|
"role_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {
|
|
"user_roles_user_id_role_id_pk": {
|
|
"name": "user_roles_user_id_role_id_pk",
|
|
"columns": [
|
|
"user_id",
|
|
"role_id"
|
|
]
|
|
}
|
|
},
|
|
"uniqueConstraints": {},
|
|
"checkConstraint": {}
|
|
},
|
|
"users": {
|
|
"name": "users",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "bigint unsigned",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "varchar(50)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
},
|
|
"password_hash": {
|
|
"name": "password_hash",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"color": {
|
|
"name": "color",
|
|
"type": "varchar(7)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
},
|
|
"avatar": {
|
|
"name": "avatar",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false,
|
|
"default": "(now())"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {
|
|
"users_id": {
|
|
"name": "users_id",
|
|
"columns": [
|
|
"id"
|
|
]
|
|
}
|
|
},
|
|
"uniqueConstraints": {
|
|
"users_name_unique": {
|
|
"name": "users_name_unique",
|
|
"columns": [
|
|
"name"
|
|
]
|
|
},
|
|
"users_email_unique": {
|
|
"name": "users_email_unique",
|
|
"columns": [
|
|
"email"
|
|
]
|
|
}
|
|
},
|
|
"checkConstraint": {}
|
|
}
|
|
},
|
|
"views": {},
|
|
"_meta": {
|
|
"schemas": {},
|
|
"tables": {},
|
|
"columns": {}
|
|
},
|
|
"internal": {
|
|
"tables": {},
|
|
"indexes": {}
|
|
}
|
|
} |