1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 00:20:07 +00:00

[sql] Update to 6.0

This commit is contained in:
zhengxie
2016-08-02 11:57:10 +08:00
parent d893a920a8
commit c585d99be5
2 changed files with 181 additions and 48 deletions

View File

@@ -9,8 +9,6 @@
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `api2_token` ( CREATE TABLE `api2_token` (
@@ -36,6 +34,8 @@ CREATE TABLE `api2_tokenv2` (
`client_version` varchar(16) NOT NULL, `client_version` varchar(16) NOT NULL,
`last_accessed` datetime NOT NULL, `last_accessed` datetime NOT NULL,
`last_login_ip` char(39) DEFAULT NULL, `last_login_ip` char(39) DEFAULT NULL,
`created_at` datetime NOT NULL,
`wiped_at` datetime DEFAULT NULL,
PRIMARY KEY (`key`), PRIMARY KEY (`key`),
UNIQUE KEY `user` (`user`,`platform`,`device_id`) UNIQUE KEY `user` (`user`,`platform`,`device_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -113,6 +113,27 @@ CREATE TABLE `base_devicetoken` (
/*!40000 ALTER TABLE `base_devicetoken` ENABLE KEYS */; /*!40000 ALTER TABLE `base_devicetoken` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `base_filecomment` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`repo_id` varchar(36) NOT NULL,
`parent_path` longtext NOT NULL,
`repo_id_parent_path_md5` varchar(100) NOT NULL,
`item_name` longtext NOT NULL,
`author` varchar(255) NOT NULL,
`comment` longtext NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `base_filecomment_9a8c79bf` (`repo_id`),
KEY `base_filecomment_c5bf47d4` (`repo_id_parent_path_md5`),
KEY `base_filecomment_02bd92fa` (`author`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `base_filecomment` DISABLE KEYS */;
/*!40000 ALTER TABLE `base_filecomment` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `base_filediscuss` ( CREATE TABLE `base_filediscuss` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
`group_message_id` int(11) NOT NULL, `group_message_id` int(11) NOT NULL,
@@ -264,11 +285,11 @@ CREATE TABLE `django_content_type` (
`model` varchar(100) NOT NULL, `model` varchar(100) NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `django_content_type_app_label_45f3b1d93ec8c61c_uniq` (`app_label`,`model`) UNIQUE KEY `django_content_type_app_label_45f3b1d93ec8c61c_uniq` (`app_label`,`model`)
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8; ) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `django_content_type` DISABLE KEYS */; /*!40000 ALTER TABLE `django_content_type` DISABLE KEYS */;
INSERT INTO `django_content_type` VALUES (10,'api2','token'),(11,'api2','tokenv2'),(12,'avatar','avatar'),(13,'avatar','groupavatar'),(15,'base','clientlogintoken'),(19,'base','commandslastcheck'),(18,'base','devicetoken'),(17,'base','filediscuss'),(14,'base','groupenabledmodule'),(20,'base','innerpubmsg'),(21,'base','innerpubmsgreply'),(16,'base','userenabledmodule'),(22,'base','userlastlogin'),(23,'base','userstarredfiles'),(4,'captcha','captchastore'),(24,'contacts','contact'),(1,'contenttypes','contenttype'),(5,'database','constance'),(30,'group','groupmessage'),(31,'group','messageattachment'),(32,'group','messagereply'),(29,'group','publicgroup'),(26,'institutions','institution'),(25,'institutions','institutionadmin'),(35,'message','usermessage'),(33,'message','usermsgattachment'),(34,'message','usermsglastcheck'),(36,'notifications','notification'),(37,'notifications','usernotification'),(38,'options','useroptions'),(47,'organizations','orgmemberquota'),(6,'post_office','attachment'),(8,'post_office','email'),(7,'post_office','emailtemplate'),(9,'post_office','log'),(40,'profile','detailedprofile'),(39,'profile','profile'),(3,'registration','registrationprofile'),(2,'sessions','session'),(44,'share','anonymousshare'),(43,'share','fileshare'),(45,'share','orgfileshare'),(41,'share','privatefiledirshare'),(42,'share','uploadlinkshare'),(46,'sysadmin_extra','userloginlog'),(28,'wiki','groupwiki'),(27,'wiki','personalwiki'); INSERT INTO `django_content_type` VALUES (10,'api2','token'),(11,'api2','tokenv2'),(12,'avatar','avatar'),(13,'avatar','groupavatar'),(15,'base','clientlogintoken'),(20,'base','commandslastcheck'),(19,'base','devicetoken'),(17,'base','filecomment'),(18,'base','filediscuss'),(14,'base','groupenabledmodule'),(21,'base','innerpubmsg'),(22,'base','innerpubmsgreply'),(16,'base','userenabledmodule'),(23,'base','userlastlogin'),(24,'base','userstarredfiles'),(4,'captcha','captchastore'),(25,'contacts','contact'),(1,'contenttypes','contenttype'),(5,'database','constance'),(32,'group','groupmessage'),(33,'group','messageattachment'),(34,'group','messagereply'),(31,'group','publicgroup'),(27,'institutions','institution'),(26,'institutions','institutionadmin'),(28,'invitations','invitation'),(37,'message','usermessage'),(35,'message','usermsgattachment'),(36,'message','usermsglastcheck'),(38,'notifications','notification'),(39,'notifications','usernotification'),(40,'options','useroptions'),(49,'organizations','orgmemberquota'),(6,'post_office','attachment'),(8,'post_office','email'),(7,'post_office','emailtemplate'),(9,'post_office','log'),(42,'profile','detailedprofile'),(41,'profile','profile'),(3,'registration','registrationprofile'),(2,'sessions','session'),(46,'share','anonymousshare'),(45,'share','fileshare'),(47,'share','orgfileshare'),(43,'share','privatefiledirshare'),(44,'share','uploadlinkshare'),(48,'sysadmin_extra','userloginlog'),(50,'two_factor','phonedevice'),(53,'two_factor','staticdevice'),(51,'two_factor','statictoken'),(52,'two_factor','totpdevice'),(30,'wiki','groupwiki'),(29,'wiki','personalwiki');
/*!40000 ALTER TABLE `django_content_type` ENABLE KEYS */; /*!40000 ALTER TABLE `django_content_type` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
@@ -278,11 +299,11 @@ CREATE TABLE `django_migrations` (
`name` varchar(255) NOT NULL, `name` varchar(255) NOT NULL,
`applied` datetime NOT NULL, `applied` datetime NOT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `django_migrations` DISABLE KEYS */; /*!40000 ALTER TABLE `django_migrations` DISABLE KEYS */;
INSERT INTO `django_migrations` VALUES (1,'captcha','0001_initial','2016-06-30 10:21:46.470795'),(2,'contenttypes','0001_initial','2016-06-30 10:21:46.526404'),(3,'contenttypes','0002_remove_content_type_name','2016-06-30 10:21:46.742298'),(4,'database','0001_initial','2016-06-30 10:21:46.766493'),(5,'institutions','0001_initial','2016-06-30 10:21:46.839693'),(6,'post_office','0001_initial','2016-06-30 10:21:47.467643'),(7,'post_office','0002_add_i18n_and_backend_alias','2016-06-30 10:21:47.915981'),(8,'sessions','0001_initial','2016-06-30 10:21:48.100284'); INSERT INTO `django_migrations` VALUES (1,'captcha','0001_initial','2016-08-02 11:51:04.446846'),(2,'contenttypes','0001_initial','2016-08-02 11:51:04.495772'),(3,'contenttypes','0002_remove_content_type_name','2016-08-02 11:51:04.567653'),(4,'database','0001_initial','2016-08-02 11:51:04.594148'),(5,'institutions','0001_initial','2016-08-02 11:51:04.668845'),(6,'invitations','0001_initial','2016-08-02 11:51:04.706963'),(7,'invitations','0002_invitation_invite_type','2016-08-02 11:51:04.744318'),(8,'invitations','0003_auto_20160510_1703','2016-08-02 11:51:04.798795'),(9,'invitations','0004_auto_20160629_1610','2016-08-02 11:51:04.873490'),(10,'invitations','0005_auto_20160629_1614','2016-08-02 11:51:04.893303'),(11,'post_office','0001_initial','2016-08-02 11:51:05.226968'),(12,'post_office','0002_add_i18n_and_backend_alias','2016-08-02 11:51:05.776662'),(13,'sessions','0001_initial','2016-08-02 11:51:05.963249'),(14,'two_factor','0001_initial','2016-08-02 11:51:06.099467');
/*!40000 ALTER TABLE `django_migrations` ENABLE KEYS */; /*!40000 ALTER TABLE `django_migrations` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
@@ -385,6 +406,25 @@ CREATE TABLE `institutions_institutionadmin` (
/*!40000 ALTER TABLE `institutions_institutionadmin` ENABLE KEYS */; /*!40000 ALTER TABLE `institutions_institutionadmin` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `invitations_invitation` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`token` varchar(40) NOT NULL,
`inviter` varchar(255) NOT NULL,
`accepter` varchar(255) NOT NULL,
`invite_time` datetime NOT NULL,
`accept_time` datetime DEFAULT NULL,
`invite_type` varchar(20) NOT NULL,
`expire_time` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `invitations_invitation_d5dd16f8` (`inviter`),
KEY `invitations_invitation_token_1961fbb98c05e5fd_uniq` (`token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `invitations_invitation` DISABLE KEYS */;
/*!40000 ALTER TABLE `invitations_invitation` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `message_usermessage` ( CREATE TABLE `message_usermessage` (
`message_id` int(11) NOT NULL AUTO_INCREMENT, `message_id` int(11) NOT NULL AUTO_INCREMENT,
`message` varchar(512) NOT NULL, `message` varchar(512) NOT NULL,
@@ -743,6 +783,73 @@ CREATE TABLE `sysadmin_extra_userloginlog` (
/*!40000 ALTER TABLE `sysadmin_extra_userloginlog` ENABLE KEYS */; /*!40000 ALTER TABLE `sysadmin_extra_userloginlog` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `two_factor_phonedevice` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user` varchar(255) NOT NULL,
`name` varchar(64) NOT NULL,
`confirmed` tinyint(1) NOT NULL,
`number` varchar(40) NOT NULL,
`key` varchar(40) NOT NULL,
`method` varchar(4) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `user` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `two_factor_phonedevice` DISABLE KEYS */;
/*!40000 ALTER TABLE `two_factor_phonedevice` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `two_factor_staticdevice` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user` varchar(255) NOT NULL,
`name` varchar(64) NOT NULL,
`confirmed` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `user` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `two_factor_staticdevice` DISABLE KEYS */;
/*!40000 ALTER TABLE `two_factor_staticdevice` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `two_factor_statictoken` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`token` varchar(16) NOT NULL,
`device_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `two_fac_device_id_55a7b345293a7c6c_fk_two_factor_staticdevice_id` (`device_id`),
KEY `two_factor_statictoken_94a08da1` (`token`),
CONSTRAINT `two_fac_device_id_55a7b345293a7c6c_fk_two_factor_staticdevice_id` FOREIGN KEY (`device_id`) REFERENCES `two_factor_staticdevice` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `two_factor_statictoken` DISABLE KEYS */;
/*!40000 ALTER TABLE `two_factor_statictoken` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `two_factor_totpdevice` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user` varchar(255) NOT NULL,
`name` varchar(64) NOT NULL,
`confirmed` tinyint(1) NOT NULL,
`key` varchar(80) NOT NULL,
`step` smallint(5) unsigned NOT NULL,
`t0` bigint(20) NOT NULL,
`digits` smallint(5) unsigned NOT NULL,
`tolerance` smallint(5) unsigned NOT NULL,
`drift` smallint(6) NOT NULL,
`last_t` bigint(20) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `user` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `two_factor_totpdevice` DISABLE KEYS */;
/*!40000 ALTER TABLE `two_factor_totpdevice` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wiki_groupwiki` ( CREATE TABLE `wiki_groupwiki` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
`group_id` int(11) NOT NULL, `group_id` int(11) NOT NULL,

View File

@@ -1,20 +1,27 @@
PRAGMA foreign_keys=OFF; PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION; BEGIN TRANSACTION;
CREATE TABLE "django_migrations" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "app" varchar(255) NOT NULL, "name" varchar(255) NOT NULL, "applied" datetime NOT NULL); CREATE TABLE "django_migrations" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "app" varchar(255) NOT NULL, "name" varchar(255) NOT NULL, "applied" datetime NOT NULL);
INSERT INTO "django_migrations" VALUES(1,'captcha','0001_initial','2016-03-19 16:26:56.445576'); INSERT INTO "django_migrations" VALUES(1,'captcha','0001_initial','2016-08-02 11:55:46.042016');
INSERT INTO "django_migrations" VALUES(2,'contenttypes','0001_initial','2016-03-19 16:26:56.535638'); INSERT INTO "django_migrations" VALUES(2,'contenttypes','0001_initial','2016-08-02 11:55:46.073441');
INSERT INTO "django_migrations" VALUES(3,'contenttypes','0002_remove_content_type_name','2016-03-19 16:26:56.575683'); INSERT INTO "django_migrations" VALUES(3,'contenttypes','0002_remove_content_type_name','2016-08-02 11:55:46.115708');
INSERT INTO "django_migrations" VALUES(4,'database','0001_initial','2016-03-19 16:26:56.588344'); INSERT INTO "django_migrations" VALUES(4,'database','0001_initial','2016-08-02 11:55:46.129599');
INSERT INTO "django_migrations" VALUES(5,'institutions','0001_initial','2016-03-19 16:26:56.616290'); INSERT INTO "django_migrations" VALUES(5,'institutions','0001_initial','2016-08-02 11:55:46.159066');
INSERT INTO "django_migrations" VALUES(6,'post_office','0001_initial','2016-03-19 16:26:56.715212'); INSERT INTO "django_migrations" VALUES(6,'invitations','0001_initial','2016-08-02 11:55:46.173229');
INSERT INTO "django_migrations" VALUES(7,'post_office','0002_add_i18n_and_backend_alias','2016-03-19 16:26:57.123126'); INSERT INTO "django_migrations" VALUES(7,'invitations','0002_invitation_invite_type','2016-08-02 11:55:46.190400');
INSERT INTO "django_migrations" VALUES(8,'sessions','0001_initial','2016-03-19 16:26:57.172678'); INSERT INTO "django_migrations" VALUES(8,'invitations','0003_auto_20160510_1703','2016-08-02 11:55:46.225410');
INSERT INTO "django_migrations" VALUES(9,'invitations','0004_auto_20160629_1610','2016-08-02 11:55:46.256625');
INSERT INTO "django_migrations" VALUES(10,'invitations','0005_auto_20160629_1614','2016-08-02 11:55:46.278074');
INSERT INTO "django_migrations" VALUES(11,'post_office','0001_initial','2016-08-02 11:55:46.384067');
INSERT INTO "django_migrations" VALUES(12,'post_office','0002_add_i18n_and_backend_alias','2016-08-02 11:55:46.858146');
INSERT INTO "django_migrations" VALUES(13,'sessions','0001_initial','2016-08-02 11:55:46.873059');
INSERT INTO "django_migrations" VALUES(14,'two_factor','0001_initial','2016-08-02 11:55:46.933775');
CREATE TABLE "registration_registrationprofile" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "emailuser_id" integer NOT NULL, "activation_key" varchar(40) NOT NULL); CREATE TABLE "registration_registrationprofile" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "emailuser_id" integer NOT NULL, "activation_key" varchar(40) NOT NULL);
CREATE TABLE "api2_token" ("key" varchar(40) NOT NULL PRIMARY KEY, "user" varchar(255) NOT NULL UNIQUE, "created" datetime NOT NULL); CREATE TABLE "api2_token" ("key" varchar(40) NOT NULL PRIMARY KEY, "user" varchar(255) NOT NULL UNIQUE, "created" datetime NOT NULL);
CREATE TABLE "api2_tokenv2" ("key" varchar(40) NOT NULL PRIMARY KEY, "user" varchar(255) NOT NULL, "platform" varchar(32) NOT NULL, "device_id" varchar(40) NOT NULL, "device_name" varchar(40) NOT NULL, "platform_version" varchar(16) NOT NULL, "client_version" varchar(16) NOT NULL, "last_accessed" datetime NOT NULL, "last_login_ip" char(39) NULL, UNIQUE ("user", "platform", "device_id")); CREATE TABLE "api2_tokenv2" ("key" varchar(40) NOT NULL PRIMARY KEY, "user" varchar(255) NOT NULL, "platform" varchar(32) NOT NULL, "device_id" varchar(40) NOT NULL, "device_name" varchar(40) NOT NULL, "platform_version" varchar(16) NOT NULL, "client_version" varchar(16) NOT NULL, "last_accessed" datetime NOT NULL, "last_login_ip" char(39) NULL, "created_at" datetime NOT NULL, "wiped_at" datetime NULL, UNIQUE ("user", "platform", "device_id"));
CREATE TABLE "avatar_avatar" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "emailuser" varchar(255) NOT NULL, "primary" bool NOT NULL, "avatar" varchar(1024) NOT NULL, "date_uploaded" datetime NOT NULL); CREATE TABLE "avatar_avatar" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "emailuser" varchar(255) NOT NULL, "primary" bool NOT NULL, "avatar" varchar(1024) NOT NULL, "date_uploaded" datetime NOT NULL);
CREATE TABLE "avatar_groupavatar" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "group_id" varchar(255) NOT NULL, "avatar" varchar(1024) NOT NULL, "date_uploaded" datetime NOT NULL); CREATE TABLE "avatar_groupavatar" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "group_id" varchar(255) NOT NULL, "avatar" varchar(1024) NOT NULL, "date_uploaded" datetime NOT NULL);
CREATE TABLE "base_filediscuss" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "group_message_id" integer NOT NULL REFERENCES "group_groupmessage" ("id"), "repo_id" varchar(36) NOT NULL, "path" text NOT NULL, "path_hash" varchar(12) NOT NULL); CREATE TABLE "base_filediscuss" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "group_message_id" integer NOT NULL REFERENCES "group_groupmessage" ("id"), "repo_id" varchar(36) NOT NULL, "path" text NOT NULL, "path_hash" varchar(12) NOT NULL);
CREATE TABLE "base_filecomment" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "repo_id" varchar(36) NOT NULL, "parent_path" text NOT NULL, "repo_id_parent_path_md5" varchar(100) NOT NULL, "item_name" text NOT NULL, "author" varchar(255) NOT NULL, "comment" text NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL);
CREATE TABLE "base_userstarredfiles" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "email" varchar(254) NOT NULL, "org_id" integer NOT NULL, "repo_id" varchar(36) NOT NULL, "path" text NOT NULL, "is_dir" bool NOT NULL); CREATE TABLE "base_userstarredfiles" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "email" varchar(254) NOT NULL, "org_id" integer NOT NULL, "repo_id" varchar(36) NOT NULL, "path" text NOT NULL, "is_dir" bool NOT NULL);
CREATE TABLE "base_userenabledmodule" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "username" varchar(255) NOT NULL, "module_name" varchar(20) NOT NULL); CREATE TABLE "base_userenabledmodule" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "username" varchar(255) NOT NULL, "module_name" varchar(20) NOT NULL);
CREATE TABLE "base_groupenabledmodule" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "group_id" varchar(10) NOT NULL, "module_name" varchar(20) NOT NULL); CREATE TABLE "base_groupenabledmodule" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "group_id" varchar(10) NOT NULL, "module_name" varchar(20) NOT NULL);
@@ -64,53 +71,68 @@ INSERT INTO "django_content_type" VALUES(13,'avatar','groupavatar');
INSERT INTO "django_content_type" VALUES(14,'base','groupenabledmodule'); INSERT INTO "django_content_type" VALUES(14,'base','groupenabledmodule');
INSERT INTO "django_content_type" VALUES(15,'base','clientlogintoken'); INSERT INTO "django_content_type" VALUES(15,'base','clientlogintoken');
INSERT INTO "django_content_type" VALUES(16,'base','userenabledmodule'); INSERT INTO "django_content_type" VALUES(16,'base','userenabledmodule');
INSERT INTO "django_content_type" VALUES(17,'base','filediscuss'); INSERT INTO "django_content_type" VALUES(17,'base','filecomment');
INSERT INTO "django_content_type" VALUES(18,'base','devicetoken'); INSERT INTO "django_content_type" VALUES(18,'base','filediscuss');
INSERT INTO "django_content_type" VALUES(19,'base','commandslastcheck'); INSERT INTO "django_content_type" VALUES(19,'base','devicetoken');
INSERT INTO "django_content_type" VALUES(20,'base','innerpubmsg'); INSERT INTO "django_content_type" VALUES(20,'base','commandslastcheck');
INSERT INTO "django_content_type" VALUES(21,'base','innerpubmsgreply'); INSERT INTO "django_content_type" VALUES(21,'base','innerpubmsg');
INSERT INTO "django_content_type" VALUES(22,'base','userlastlogin'); INSERT INTO "django_content_type" VALUES(22,'base','innerpubmsgreply');
INSERT INTO "django_content_type" VALUES(23,'base','userstarredfiles'); INSERT INTO "django_content_type" VALUES(23,'base','userlastlogin');
INSERT INTO "django_content_type" VALUES(24,'contacts','contact'); INSERT INTO "django_content_type" VALUES(24,'base','userstarredfiles');
INSERT INTO "django_content_type" VALUES(25,'institutions','institutionadmin'); INSERT INTO "django_content_type" VALUES(25,'contacts','contact');
INSERT INTO "django_content_type" VALUES(26,'institutions','institution'); INSERT INTO "django_content_type" VALUES(26,'institutions','institutionadmin');
INSERT INTO "django_content_type" VALUES(27,'wiki','personalwiki'); INSERT INTO "django_content_type" VALUES(27,'institutions','institution');
INSERT INTO "django_content_type" VALUES(28,'wiki','groupwiki'); INSERT INTO "django_content_type" VALUES(28,'invitations','invitation');
INSERT INTO "django_content_type" VALUES(29,'group','publicgroup'); INSERT INTO "django_content_type" VALUES(29,'wiki','personalwiki');
INSERT INTO "django_content_type" VALUES(30,'group','groupmessage'); INSERT INTO "django_content_type" VALUES(30,'wiki','groupwiki');
INSERT INTO "django_content_type" VALUES(31,'group','messageattachment'); INSERT INTO "django_content_type" VALUES(31,'group','publicgroup');
INSERT INTO "django_content_type" VALUES(32,'group','messagereply'); INSERT INTO "django_content_type" VALUES(32,'group','groupmessage');
INSERT INTO "django_content_type" VALUES(33,'message','usermsgattachment'); INSERT INTO "django_content_type" VALUES(33,'group','messageattachment');
INSERT INTO "django_content_type" VALUES(34,'message','usermsglastcheck'); INSERT INTO "django_content_type" VALUES(34,'group','messagereply');
INSERT INTO "django_content_type" VALUES(35,'message','usermessage'); INSERT INTO "django_content_type" VALUES(35,'message','usermsgattachment');
INSERT INTO "django_content_type" VALUES(36,'notifications','notification'); INSERT INTO "django_content_type" VALUES(36,'message','usermsglastcheck');
INSERT INTO "django_content_type" VALUES(37,'notifications','usernotification'); INSERT INTO "django_content_type" VALUES(37,'message','usermessage');
INSERT INTO "django_content_type" VALUES(38,'options','useroptions'); INSERT INTO "django_content_type" VALUES(38,'notifications','notification');
INSERT INTO "django_content_type" VALUES(39,'profile','profile'); INSERT INTO "django_content_type" VALUES(39,'notifications','usernotification');
INSERT INTO "django_content_type" VALUES(40,'profile','detailedprofile'); INSERT INTO "django_content_type" VALUES(40,'options','useroptions');
INSERT INTO "django_content_type" VALUES(41,'share','privatefiledirshare'); INSERT INTO "django_content_type" VALUES(41,'profile','profile');
INSERT INTO "django_content_type" VALUES(42,'share','uploadlinkshare'); INSERT INTO "django_content_type" VALUES(42,'profile','detailedprofile');
INSERT INTO "django_content_type" VALUES(43,'share','fileshare'); INSERT INTO "django_content_type" VALUES(43,'share','privatefiledirshare');
INSERT INTO "django_content_type" VALUES(44,'share','anonymousshare'); INSERT INTO "django_content_type" VALUES(44,'share','uploadlinkshare');
INSERT INTO "django_content_type" VALUES(45,'share','orgfileshare'); INSERT INTO "django_content_type" VALUES(45,'share','fileshare');
INSERT INTO "django_content_type" VALUES(46,'sysadmin_extra','userloginlog'); INSERT INTO "django_content_type" VALUES(46,'share','anonymousshare');
INSERT INTO "django_content_type" VALUES(47,'organizations','orgmemberquota'); INSERT INTO "django_content_type" VALUES(47,'share','orgfileshare');
INSERT INTO "django_content_type" VALUES(48,'sysadmin_extra','userloginlog');
INSERT INTO "django_content_type" VALUES(49,'organizations','orgmemberquota');
INSERT INTO "django_content_type" VALUES(50,'two_factor','phonedevice');
INSERT INTO "django_content_type" VALUES(51,'two_factor','statictoken');
INSERT INTO "django_content_type" VALUES(52,'two_factor','totpdevice');
INSERT INTO "django_content_type" VALUES(53,'two_factor','staticdevice');
CREATE TABLE "constance_config" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "key" varchar(255) NOT NULL UNIQUE, "value" text NOT NULL); CREATE TABLE "constance_config" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "key" varchar(255) NOT NULL UNIQUE, "value" text NOT NULL);
CREATE TABLE "institutions_institution" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "name" varchar(200) NOT NULL, "create_time" datetime NOT NULL); CREATE TABLE "institutions_institution" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "name" varchar(200) NOT NULL, "create_time" datetime NOT NULL);
CREATE TABLE "institutions_institutionadmin" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "user" varchar(254) NOT NULL, "institution_id" integer NOT NULL REFERENCES "institutions_institution" ("id")); CREATE TABLE "institutions_institutionadmin" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "user" varchar(254) NOT NULL, "institution_id" integer NOT NULL REFERENCES "institutions_institution" ("id"));
CREATE TABLE "invitations_invitation" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "token" varchar(40) NOT NULL, "inviter" varchar(255) NOT NULL, "accepter" varchar(255) NOT NULL, "invite_time" datetime NOT NULL, "accept_time" datetime NULL, "invite_type" varchar(20) NOT NULL, "expire_time" datetime NOT NULL);
CREATE TABLE "post_office_attachment" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "file" varchar(100) NOT NULL, "name" varchar(255) NOT NULL); CREATE TABLE "post_office_attachment" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "file" varchar(100) NOT NULL, "name" varchar(255) NOT NULL);
CREATE TABLE "post_office_log" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "date" datetime NOT NULL, "status" smallint unsigned NOT NULL, "exception_type" varchar(255) NOT NULL, "message" text NOT NULL, "email_id" integer NOT NULL REFERENCES "post_office_email" ("id")); CREATE TABLE "post_office_log" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "date" datetime NOT NULL, "status" smallint unsigned NOT NULL, "exception_type" varchar(255) NOT NULL, "message" text NOT NULL, "email_id" integer NOT NULL REFERENCES "post_office_email" ("id"));
CREATE TABLE "post_office_attachment_emails" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "attachment_id" integer NOT NULL REFERENCES "post_office_attachment" ("id"), "email_id" integer NOT NULL REFERENCES "post_office_email" ("id"), UNIQUE ("attachment_id", "email_id")); CREATE TABLE "post_office_attachment_emails" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "attachment_id" integer NOT NULL REFERENCES "post_office_attachment" ("id"), "email_id" integer NOT NULL REFERENCES "post_office_email" ("id"), UNIQUE ("attachment_id", "email_id"));
CREATE TABLE "post_office_email" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "from_email" varchar(254) NOT NULL, "cc" text NOT NULL, "bcc" text NOT NULL, "subject" varchar(255) NOT NULL, "message" text NOT NULL, "html_message" text NOT NULL, "status" smallint unsigned NULL, "priority" smallint unsigned NULL, "created" datetime NOT NULL, "last_updated" datetime NOT NULL, "scheduled_time" datetime NULL, "headers" text NULL, "context" text NULL, "template_id" integer NULL REFERENCES "post_office_emailtemplate" ("id"), "backend_alias" varchar(64) NOT NULL, "to" text NOT NULL); CREATE TABLE "post_office_email" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "from_email" varchar(254) NOT NULL, "cc" text NOT NULL, "bcc" text NOT NULL, "subject" varchar(255) NOT NULL, "message" text NOT NULL, "html_message" text NOT NULL, "status" smallint unsigned NULL, "priority" smallint unsigned NULL, "created" datetime NOT NULL, "last_updated" datetime NOT NULL, "scheduled_time" datetime NULL, "headers" text NULL, "context" text NULL, "template_id" integer NULL REFERENCES "post_office_emailtemplate" ("id"), "backend_alias" varchar(64) NOT NULL, "to" text NOT NULL);
CREATE TABLE "post_office_emailtemplate" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "name" varchar(255) NOT NULL, "description" text NOT NULL, "subject" varchar(255) NOT NULL, "content" text NOT NULL, "html_content" text NOT NULL, "created" datetime NOT NULL, "last_updated" datetime NOT NULL, "default_template_id" integer NULL REFERENCES "post_office_emailtemplate" ("id"), "language" varchar(12) NOT NULL, UNIQUE ("language", "default_template_id")); CREATE TABLE "post_office_emailtemplate" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "name" varchar(255) NOT NULL, "description" text NOT NULL, "subject" varchar(255) NOT NULL, "content" text NOT NULL, "html_content" text NOT NULL, "created" datetime NOT NULL, "last_updated" datetime NOT NULL, "default_template_id" integer NULL REFERENCES "post_office_emailtemplate" ("id"), "language" varchar(12) NOT NULL, UNIQUE ("language", "default_template_id"));
CREATE TABLE "django_session" ("session_key" varchar(40) NOT NULL PRIMARY KEY, "session_data" text NOT NULL, "expire_date" datetime NOT NULL); CREATE TABLE "django_session" ("session_key" varchar(40) NOT NULL PRIMARY KEY, "session_data" text NOT NULL, "expire_date" datetime NOT NULL);
CREATE TABLE "two_factor_phonedevice" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "user" varchar(255) NOT NULL UNIQUE, "name" varchar(64) NOT NULL, "confirmed" bool NOT NULL, "number" varchar(40) NOT NULL, "key" varchar(40) NOT NULL, "method" varchar(4) NOT NULL);
CREATE TABLE "two_factor_staticdevice" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "user" varchar(255) NOT NULL UNIQUE, "name" varchar(64) NOT NULL, "confirmed" bool NOT NULL);
CREATE TABLE "two_factor_statictoken" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "token" varchar(16) NOT NULL, "device_id" integer NOT NULL REFERENCES "two_factor_staticdevice" ("id"));
CREATE TABLE "two_factor_totpdevice" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "user" varchar(255) NOT NULL UNIQUE, "name" varchar(64) NOT NULL, "confirmed" bool NOT NULL, "key" varchar(80) NOT NULL, "step" smallint unsigned NOT NULL, "t0" bigint NOT NULL, "digits" smallint unsigned NOT NULL, "tolerance" smallint unsigned NOT NULL, "drift" smallint NOT NULL, "last_t" bigint NOT NULL);
DELETE FROM sqlite_sequence; DELETE FROM sqlite_sequence;
INSERT INTO "sqlite_sequence" VALUES('django_migrations',8); INSERT INTO "sqlite_sequence" VALUES('django_migrations',14);
INSERT INTO "sqlite_sequence" VALUES('django_content_type',47); INSERT INTO "sqlite_sequence" VALUES('django_content_type',53);
INSERT INTO "sqlite_sequence" VALUES('invitations_invitation',0);
INSERT INTO "sqlite_sequence" VALUES('post_office_email',0); INSERT INTO "sqlite_sequence" VALUES('post_office_email',0);
INSERT INTO "sqlite_sequence" VALUES('post_office_emailtemplate',0); INSERT INTO "sqlite_sequence" VALUES('post_office_emailtemplate',0);
CREATE INDEX "base_filediscuss_06a351d8" ON "base_filediscuss" ("group_message_id"); CREATE INDEX "base_filediscuss_06a351d8" ON "base_filediscuss" ("group_message_id");
CREATE INDEX "base_filediscuss_b57d9b6b" ON "base_filediscuss" ("path_hash"); CREATE INDEX "base_filediscuss_b57d9b6b" ON "base_filediscuss" ("path_hash");
CREATE INDEX "base_filecomment_9a8c79bf" ON "base_filecomment" ("repo_id");
CREATE INDEX "base_filecomment_c5bf47d4" ON "base_filecomment" ("repo_id_parent_path_md5");
CREATE INDEX "base_filecomment_02bd92fa" ON "base_filecomment" ("author");
CREATE INDEX "base_userstarredfiles_0c83f57c" ON "base_userstarredfiles" ("email"); CREATE INDEX "base_userstarredfiles_0c83f57c" ON "base_userstarredfiles" ("email");
CREATE INDEX "base_userstarredfiles_9a8c79bf" ON "base_userstarredfiles" ("repo_id"); CREATE INDEX "base_userstarredfiles_9a8c79bf" ON "base_userstarredfiles" ("repo_id");
CREATE INDEX "base_userenabledmodule_14c4b06b" ON "base_userenabledmodule" ("username"); CREATE INDEX "base_userenabledmodule_14c4b06b" ON "base_userenabledmodule" ("username");
@@ -146,6 +168,8 @@ CREATE INDEX "sysadmin_extra_userloginlog_14c4b06b" ON "sysadmin_extra_userlogin
CREATE INDEX "sysadmin_extra_userloginlog_28ed1ef0" ON "sysadmin_extra_userloginlog" ("login_date"); CREATE INDEX "sysadmin_extra_userloginlog_28ed1ef0" ON "sysadmin_extra_userloginlog" ("login_date");
CREATE INDEX "organizations_orgmemberquota_9cf869aa" ON "organizations_orgmemberquota" ("org_id"); CREATE INDEX "organizations_orgmemberquota_9cf869aa" ON "organizations_orgmemberquota" ("org_id");
CREATE INDEX "institutions_institutionadmin_a964baeb" ON "institutions_institutionadmin" ("institution_id"); CREATE INDEX "institutions_institutionadmin_a964baeb" ON "institutions_institutionadmin" ("institution_id");
CREATE INDEX "invitations_invitation_94a08da1" ON "invitations_invitation" ("token");
CREATE INDEX "invitations_invitation_d5dd16f8" ON "invitations_invitation" ("inviter");
CREATE INDEX "post_office_log_fdfd0ebf" ON "post_office_log" ("email_id"); CREATE INDEX "post_office_log_fdfd0ebf" ON "post_office_log" ("email_id");
CREATE INDEX "post_office_attachment_emails_07ba63f5" ON "post_office_attachment_emails" ("attachment_id"); CREATE INDEX "post_office_attachment_emails_07ba63f5" ON "post_office_attachment_emails" ("attachment_id");
CREATE INDEX "post_office_attachment_emails_fdfd0ebf" ON "post_office_attachment_emails" ("email_id"); CREATE INDEX "post_office_attachment_emails_fdfd0ebf" ON "post_office_attachment_emails" ("email_id");
@@ -156,4 +180,6 @@ CREATE INDEX "post_office_email_ed24d584" ON "post_office_email" ("scheduled_tim
CREATE INDEX "post_office_email_74f53564" ON "post_office_email" ("template_id"); CREATE INDEX "post_office_email_74f53564" ON "post_office_email" ("template_id");
CREATE INDEX "post_office_emailtemplate_dea6f63e" ON "post_office_emailtemplate" ("default_template_id"); CREATE INDEX "post_office_emailtemplate_dea6f63e" ON "post_office_emailtemplate" ("default_template_id");
CREATE INDEX "django_session_de54fa62" ON "django_session" ("expire_date"); CREATE INDEX "django_session_de54fa62" ON "django_session" ("expire_date");
CREATE INDEX "two_factor_statictoken_94a08da1" ON "two_factor_statictoken" ("token");
CREATE INDEX "two_factor_statictoken_9379346c" ON "two_factor_statictoken" ("device_id");
COMMIT; COMMIT;