openvk/install/sqls/00031-apps.sql
Alexander Minkin 5710d131fd
SQL: Reorder migration files
The issue was that numbers were duplicating, so I decided to fix them
2023-09-23 01:18:33 +03:00

22 lines
807 B
SQL

CREATE TABLE IF NOT EXISTS `apps` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`owner` bigint unsigned NOT NULL,
`name` varchar(255) NOT NULL,
`description` text NOT NULL,
`avatar_hash` char(8) DEFAULT NULL,
`news` bigint DEFAULT NULL,
`address` varchar(1024) NOT NULL,
`coins` decimal(20,6) NOT NULL DEFAULT '0.000000',
`enabled` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`id`),
KEY `owner` (`owner`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
CREATE TABLE IF NOT EXISTS `app_users` (
`app` bigint unsigned NOT NULL,
`user` bigint unsigned NOT NULL,
`access` smallint unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`app`,`user`),
KEY `app` (`app`),
KEY `user` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;