1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 15:53:28 +00:00

[sql] Update sql to 6.1

This commit is contained in:
zhengxie
2017-04-28 17:12:13 +08:00
parent 25637830c2
commit 09112d9f41
3 changed files with 92 additions and 109 deletions

View File

@@ -261,7 +261,7 @@ class UploadLinkShare(models.Model):
username = LowerCaseCharField(max_length=255, db_index=True)
repo_id = models.CharField(max_length=36, db_index=True)
path = models.TextField()
token = models.CharField(max_length=10, unique=True)
token = models.CharField(max_length=100, unique=True)
ctime = models.DateTimeField(default=datetime.datetime.now)
view_cnt = models.IntegerField(default=0)
password = models.CharField(max_length=128, null=True)

View File

@@ -11,6 +11,22 @@
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `admin_log_adminlog` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(254) NOT NULL,
`operation` varchar(255) NOT NULL,
`detail` longtext NOT NULL,
`datetime` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `admin_log_adminlog_0c83f57c` (`email`),
KEY `admin_log_adminlog_f7235a61` (`operation`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `admin_log_adminlog` DISABLE KEYS */;
/*!40000 ALTER TABLE `admin_log_adminlog` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `api2_token` (
`key` varchar(40) NOT NULL,
`user` varchar(255) NOT NULL,
@@ -285,11 +301,11 @@ CREATE TABLE `django_content_type` (
`model` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `django_content_type_app_label_45f3b1d93ec8c61c_uniq` (`app_label`,`model`)
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8;
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `django_content_type` DISABLE KEYS */;
INSERT INTO `django_content_type` VALUES (12,'api2','token'),(13,'api2','tokenv2'),(14,'avatar','avatar'),(15,'avatar','groupavatar'),(17,'base','clientlogintoken'),(22,'base','commandslastcheck'),(21,'base','devicetoken'),(19,'base','filecomment'),(20,'base','filediscuss'),(16,'base','groupenabledmodule'),(23,'base','innerpubmsg'),(24,'base','innerpubmsgreply'),(18,'base','userenabledmodule'),(25,'base','userlastlogin'),(26,'base','userstarredfiles'),(4,'captcha','captchastore'),(27,'contacts','contact'),(1,'contenttypes','contenttype'),(5,'database','constance'),(34,'group','groupmessage'),(35,'group','messageattachment'),(36,'group','messagereply'),(33,'group','publicgroup'),(29,'institutions','institution'),(28,'institutions','institutionadmin'),(30,'invitations','invitation'),(39,'message','usermessage'),(37,'message','usermsgattachment'),(38,'message','usermsglastcheck'),(40,'notifications','notification'),(41,'notifications','usernotification'),(42,'options','useroptions'),(51,'organizations','orgmemberquota'),(6,'post_office','attachment'),(8,'post_office','email'),(7,'post_office','emailtemplate'),(9,'post_office','log'),(44,'profile','detailedprofile'),(43,'profile','profile'),(3,'registration','registrationprofile'),(2,'sessions','session'),(48,'share','anonymousshare'),(47,'share','fileshare'),(49,'share','orgfileshare'),(45,'share','privatefiledirshare'),(46,'share','uploadlinkshare'),(50,'sysadmin_extra','userloginlog'),(10,'termsandconditions','termsandconditions'),(11,'termsandconditions','usertermsandconditions'),(52,'two_factor','phonedevice'),(55,'two_factor','staticdevice'),(53,'two_factor','statictoken'),(54,'two_factor','totpdevice'),(32,'wiki','groupwiki'),(31,'wiki','personalwiki');
INSERT INTO `django_content_type` VALUES (48,'admin_log','adminlog'),(12,'api2','token'),(13,'api2','tokenv2'),(14,'avatar','avatar'),(15,'avatar','groupavatar'),(17,'base','clientlogintoken'),(22,'base','commandslastcheck'),(21,'base','devicetoken'),(19,'base','filecomment'),(20,'base','filediscuss'),(16,'base','groupenabledmodule'),(23,'base','innerpubmsg'),(24,'base','innerpubmsgreply'),(18,'base','userenabledmodule'),(25,'base','userlastlogin'),(26,'base','userstarredfiles'),(4,'captcha','captchastore'),(27,'contacts','contact'),(1,'contenttypes','contenttype'),(5,'database','constance'),(35,'group','groupmessage'),(36,'group','messageattachment'),(37,'group','messagereply'),(34,'group','publicgroup'),(29,'institutions','institution'),(28,'institutions','institutionadmin'),(30,'institutions','institutionquota'),(31,'invitations','invitation'),(38,'notifications','notification'),(39,'notifications','usernotification'),(40,'options','useroptions'),(50,'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'),(49,'sysadmin_extra','userloginlog'),(10,'termsandconditions','termsandconditions'),(11,'termsandconditions','usertermsandconditions'),(51,'two_factor','phonedevice'),(54,'two_factor','staticdevice'),(52,'two_factor','statictoken'),(53,'two_factor','totpdevice'),(33,'wiki','groupwiki'),(32,'wiki','personalwiki');
/*!40000 ALTER TABLE `django_content_type` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -299,11 +315,11 @@ CREATE TABLE `django_migrations` (
`name` varchar(255) NOT NULL,
`applied` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `django_migrations` DISABLE KEYS */;
INSERT INTO `django_migrations` VALUES (1,'captcha','0001_initial','2016-08-02 14:48:00.596152'),(2,'contenttypes','0001_initial','2016-08-02 14:48:00.797303'),(3,'contenttypes','0002_remove_content_type_name','2016-08-02 14:48:00.879450'),(4,'database','0001_initial','2016-08-02 14:48:00.902084'),(5,'institutions','0001_initial','2016-08-02 14:48:01.021340'),(6,'invitations','0001_initial','2016-08-02 14:48:01.068479'),(7,'invitations','0002_invitation_invite_type','2016-08-02 14:48:01.105755'),(8,'invitations','0003_auto_20160510_1703','2016-08-02 14:48:01.163442'),(9,'invitations','0004_auto_20160629_1610','2016-08-02 14:48:01.265499'),(10,'invitations','0005_auto_20160629_1614','2016-08-02 14:48:01.290426'),(11,'post_office','0001_initial','2016-08-02 14:48:01.727406'),(12,'post_office','0002_add_i18n_and_backend_alias','2016-08-02 14:48:02.927550'),(13,'sessions','0001_initial','2016-08-02 14:48:02.976884'),(14,'termsandconditions','0001_initial','2016-08-02 14:48:03.107817'),(15,'two_factor','0001_initial','2016-08-02 14:48:03.249115');
INSERT INTO `django_migrations` VALUES (1,'admin_log','0001_initial','2017-04-28 08:59:43.344829'),(2,'captcha','0001_initial','2017-04-28 08:59:43.391050'),(3,'contenttypes','0001_initial','2017-04-28 08:59:43.455216'),(4,'contenttypes','0002_remove_content_type_name','2017-04-28 08:59:43.574756'),(5,'database','0001_initial','2017-04-28 08:59:43.606652'),(6,'institutions','0001_initial','2017-04-28 08:59:43.708428'),(7,'institutions','0002_institutionquota','2017-04-28 08:59:43.775756'),(8,'invitations','0001_initial','2017-04-28 08:59:43.984567'),(9,'invitations','0002_invitation_invite_type','2017-04-28 08:59:44.208796'),(10,'invitations','0003_auto_20160510_1703','2017-04-28 08:59:44.276843'),(11,'invitations','0004_auto_20160629_1610','2017-04-28 08:59:44.379998'),(12,'invitations','0005_auto_20160629_1614','2017-04-28 08:59:44.400270'),(13,'post_office','0001_initial','2017-04-28 08:59:44.791069'),(14,'post_office','0002_add_i18n_and_backend_alias','2017-04-28 08:59:45.499079'),(15,'sessions','0001_initial','2017-04-28 08:59:45.707769'),(16,'termsandconditions','0001_initial','2017-04-28 08:59:45.887480'),(17,'two_factor','0001_initial','2017-04-28 08:59:46.076000');
/*!40000 ALTER TABLE `django_migrations` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -324,7 +340,7 @@ CREATE TABLE `group_groupmessage` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`group_id` int(11) NOT NULL,
`from_email` varchar(255) NOT NULL,
`message` varchar(2048) NOT NULL,
`message` longtext NOT NULL,
`timestamp` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `group_groupmessage_0e939a4f` (`group_id`)
@@ -356,7 +372,7 @@ CREATE TABLE `group_messagereply` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`reply_to_id` int(11) NOT NULL,
`from_email` varchar(255) NOT NULL,
`message` varchar(2048) NOT NULL,
`message` longtext NOT NULL,
`timestamp` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `group_mess_reply_to_id_23113ea180894951_fk_group_groupmessage_id` (`reply_to_id`),
@@ -406,6 +422,20 @@ CREATE TABLE `institutions_institutionadmin` (
/*!40000 ALTER TABLE `institutions_institutionadmin` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `institutions_institutionquota` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`quota` bigint(20) NOT NULL,
`institution_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `i_institution_id_2ca7c89373390e2c_fk_institutions_institution_id` (`institution_id`),
CONSTRAINT `i_institution_id_2ca7c89373390e2c_fk_institutions_institution_id` FOREIGN KEY (`institution_id`) REFERENCES `institutions_institution` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `institutions_institutionquota` DISABLE KEYS */;
/*!40000 ALTER TABLE `institutions_institutionquota` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `invitations_invitation` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`token` varchar(40) NOT NULL,
@@ -425,52 +455,6 @@ CREATE TABLE `invitations_invitation` (
/*!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` (
`message_id` int(11) NOT NULL AUTO_INCREMENT,
`message` varchar(512) NOT NULL,
`from_email` varchar(255) NOT NULL,
`to_email` varchar(255) NOT NULL,
`timestamp` datetime NOT NULL,
`ifread` tinyint(1) NOT NULL,
`sender_deleted_at` datetime DEFAULT NULL,
`recipient_deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`message_id`),
KEY `message_usermessage_f50bd8c4` (`from_email`),
KEY `message_usermessage_acc047cf` (`to_email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `message_usermessage` DISABLE KEYS */;
/*!40000 ALTER TABLE `message_usermessage` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `message_usermsgattachment` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_msg_id` int(11) NOT NULL,
`priv_file_dir_share_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `m_user_msg_id_3f10b9ac43610631_fk_message_usermessage_message_id` (`user_msg_id`),
KEY `D0bceb1017884f579a81b2fab45df4e7` (`priv_file_dir_share_id`),
CONSTRAINT `D0bceb1017884f579a81b2fab45df4e7` FOREIGN KEY (`priv_file_dir_share_id`) REFERENCES `share_privatefiledirshare` (`id`),
CONSTRAINT `m_user_msg_id_3f10b9ac43610631_fk_message_usermessage_message_id` FOREIGN KEY (`user_msg_id`) REFERENCES `message_usermessage` (`message_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `message_usermsgattachment` DISABLE KEYS */;
/*!40000 ALTER TABLE `message_usermsgattachment` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `message_usermsglastcheck` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`check_time` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `message_usermsglastcheck` DISABLE KEYS */;
/*!40000 ALTER TABLE `message_usermsglastcheck` ENABLE KEYS */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `notifications_notification` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`message` varchar(512) NOT NULL,
@@ -693,7 +677,7 @@ CREATE TABLE `share_fileshare` (
`username` varchar(255) NOT NULL,
`repo_id` varchar(36) NOT NULL,
`path` longtext NOT NULL,
`token` varchar(10) NOT NULL,
`token` varchar(100) NOT NULL,
`ctime` datetime NOT NULL,
`view_cnt` int(11) NOT NULL,
`s_type` varchar(2) NOT NULL,
@@ -752,7 +736,7 @@ CREATE TABLE `share_uploadlinkshare` (
`username` varchar(255) NOT NULL,
`repo_id` varchar(36) NOT NULL,
`path` longtext NOT NULL,
`token` varchar(10) NOT NULL,
`token` varchar(100) NOT NULL,
`ctime` datetime NOT NULL,
`view_cnt` int(11) NOT NULL,
`password` varchar(128) DEFAULT NULL,

View File

@@ -1,21 +1,23 @@
PRAGMA foreign_keys=OFF;
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);
INSERT INTO "django_migrations" VALUES(1,'captcha','0001_initial','2016-08-02 14:46:37.874354');
INSERT INTO "django_migrations" VALUES(2,'contenttypes','0001_initial','2016-08-02 14:46:37.899146');
INSERT INTO "django_migrations" VALUES(3,'contenttypes','0002_remove_content_type_name','2016-08-02 14:46:37.943407');
INSERT INTO "django_migrations" VALUES(4,'database','0001_initial','2016-08-02 14:46:37.955558');
INSERT INTO "django_migrations" VALUES(5,'institutions','0001_initial','2016-08-02 14:46:37.984276');
INSERT INTO "django_migrations" VALUES(6,'invitations','0001_initial','2016-08-02 14:46:38.001119');
INSERT INTO "django_migrations" VALUES(7,'invitations','0002_invitation_invite_type','2016-08-02 14:46:38.016749');
INSERT INTO "django_migrations" VALUES(8,'invitations','0003_auto_20160510_1703','2016-08-02 14:46:38.048838');
INSERT INTO "django_migrations" VALUES(9,'invitations','0004_auto_20160629_1610','2016-08-02 14:46:38.080737');
INSERT INTO "django_migrations" VALUES(10,'invitations','0005_auto_20160629_1614','2016-08-02 14:46:38.101288');
INSERT INTO "django_migrations" VALUES(11,'post_office','0001_initial','2016-08-02 14:46:38.208733');
INSERT INTO "django_migrations" VALUES(12,'post_office','0002_add_i18n_and_backend_alias','2016-08-02 14:46:38.680198');
INSERT INTO "django_migrations" VALUES(13,'sessions','0001_initial','2016-08-02 14:46:38.695732');
INSERT INTO "django_migrations" VALUES(14,'termsandconditions','0001_initial','2016-08-02 14:46:38.750499');
INSERT INTO "django_migrations" VALUES(15,'two_factor','0001_initial','2016-08-02 14:46:38.813771');
INSERT INTO "django_migrations" VALUES(1,'admin_log','0001_initial','2017-04-28 09:04:58.420104');
INSERT INTO "django_migrations" VALUES(2,'captcha','0001_initial','2017-04-28 09:04:58.440561');
INSERT INTO "django_migrations" VALUES(3,'contenttypes','0001_initial','2017-04-28 09:04:58.499792');
INSERT INTO "django_migrations" VALUES(4,'contenttypes','0002_remove_content_type_name','2017-04-28 09:04:58.548426');
INSERT INTO "django_migrations" VALUES(5,'database','0001_initial','2017-04-28 09:04:58.566919');
INSERT INTO "django_migrations" VALUES(6,'institutions','0001_initial','2017-04-28 09:04:58.605616');
INSERT INTO "django_migrations" VALUES(7,'institutions','0002_institutionquota','2017-04-28 09:04:58.631708');
INSERT INTO "django_migrations" VALUES(8,'invitations','0001_initial','2017-04-28 09:04:58.792401');
INSERT INTO "django_migrations" VALUES(9,'invitations','0002_invitation_invite_type','2017-04-28 09:04:58.814384');
INSERT INTO "django_migrations" VALUES(10,'invitations','0003_auto_20160510_1703','2017-04-28 09:04:58.845281');
INSERT INTO "django_migrations" VALUES(11,'invitations','0004_auto_20160629_1610','2017-04-28 09:04:58.883482');
INSERT INTO "django_migrations" VALUES(12,'invitations','0005_auto_20160629_1614','2017-04-28 09:04:58.901891');
INSERT INTO "django_migrations" VALUES(13,'post_office','0001_initial','2017-04-28 09:04:59.002314');
INSERT INTO "django_migrations" VALUES(14,'post_office','0002_add_i18n_and_backend_alias','2017-04-28 09:04:59.442384');
INSERT INTO "django_migrations" VALUES(15,'sessions','0001_initial','2017-04-28 09:04:59.459015');
INSERT INTO "django_migrations" VALUES(16,'termsandconditions','0001_initial','2017-04-28 09:04:59.512431');
INSERT INTO "django_migrations" VALUES(17,'two_factor','0001_initial','2017-04-28 09:04:59.574323');
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_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"));
@@ -35,25 +37,23 @@ CREATE TABLE "base_clientlogintoken" ("token" varchar(32) NOT NULL PRIMARY KEY,
CREATE TABLE "contacts_contact" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "user_email" varchar(255) NOT NULL, "contact_email" varchar(255) NOT NULL, "contact_name" varchar(255) NULL, "note" varchar(255) NULL);
CREATE TABLE "wiki_personalwiki" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "username" varchar(255) NOT NULL UNIQUE, "repo_id" varchar(36) NOT NULL);
CREATE TABLE "wiki_groupwiki" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "group_id" integer NOT NULL UNIQUE, "repo_id" varchar(36) NOT NULL);
CREATE TABLE "group_groupmessage" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "group_id" integer NOT NULL, "from_email" varchar(255) NOT NULL, "message" varchar(2048) NOT NULL, "timestamp" datetime NOT NULL);
CREATE TABLE "group_messagereply" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "reply_to_id" integer NOT NULL REFERENCES "group_groupmessage" ("id"), "from_email" varchar(255) NOT NULL, "message" varchar(2048) NOT NULL, "timestamp" datetime NOT NULL);
CREATE TABLE "group_groupmessage" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "group_id" integer NOT NULL, "from_email" varchar(255) NOT NULL, "message" text NOT NULL, "timestamp" datetime NOT NULL);
CREATE TABLE "group_messagereply" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "reply_to_id" integer NOT NULL REFERENCES "group_groupmessage" ("id"), "from_email" varchar(255) NOT NULL, "message" text NOT NULL, "timestamp" datetime NOT NULL);
CREATE TABLE "group_messageattachment" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "group_message_id" integer NOT NULL REFERENCES "group_groupmessage" ("id"), "repo_id" varchar(40) NOT NULL, "attach_type" varchar(5) NOT NULL, "path" text NOT NULL, "src" varchar(20) NOT NULL);
CREATE TABLE "group_publicgroup" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "group_id" integer NOT NULL);
CREATE TABLE "message_usermessage" ("message_id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "message" varchar(512) NOT NULL, "from_email" varchar(255) NOT NULL, "to_email" varchar(255) NOT NULL, "timestamp" datetime NOT NULL, "ifread" bool NOT NULL, "sender_deleted_at" datetime NULL, "recipient_deleted_at" datetime NULL);
CREATE TABLE "message_usermsglastcheck" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "check_time" datetime NOT NULL);
CREATE TABLE "message_usermsgattachment" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "user_msg_id" integer NOT NULL REFERENCES "message_usermessage" ("message_id"), "priv_file_dir_share_id" integer NULL REFERENCES "share_privatefiledirshare" ("id"));
CREATE TABLE "notifications_notification" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "message" varchar(512) NOT NULL, "primary" bool NOT NULL);
CREATE TABLE "notifications_usernotification" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "to_user" varchar(255) NOT NULL, "msg_type" varchar(30) NOT NULL, "detail" text NOT NULL, "timestamp" datetime NOT NULL, "seen" bool NOT NULL);
CREATE TABLE "options_useroptions" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "email" varchar(255) NOT NULL, "option_key" varchar(50) NOT NULL, "option_val" varchar(50) NOT NULL);
CREATE TABLE "profile_profile" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "user" varchar(254) NOT NULL UNIQUE, "nickname" varchar(64) NOT NULL, "intro" text NOT NULL, "lang_code" text NULL, "login_id" varchar(225) NULL UNIQUE, "contact_email" varchar(225) NULL, "institution" varchar(225) NULL);
CREATE TABLE "profile_detailedprofile" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "user" varchar(255) NOT NULL, "department" varchar(512) NOT NULL, "telephone" varchar(100) NOT NULL);
CREATE TABLE "share_anonymousshare" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "repo_owner" varchar(255) NOT NULL, "repo_id" varchar(36) NOT NULL, "anonymous_email" varchar(255) NOT NULL, "token" varchar(25) NOT NULL UNIQUE);
CREATE TABLE "share_fileshare" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "username" varchar(255) NOT NULL, "repo_id" varchar(36) NOT NULL, "path" text NOT NULL, "token" varchar(10) NOT NULL UNIQUE, "ctime" datetime NOT NULL, "view_cnt" integer NOT NULL, "s_type" varchar(2) NOT NULL, "password" varchar(128) NULL, "expire_date" datetime NULL);
CREATE TABLE "share_fileshare" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "username" varchar(255) NOT NULL, "repo_id" varchar(36) NOT NULL, "path" text NOT NULL, "token" varchar(100) NOT NULL UNIQUE, "ctime" datetime NOT NULL, "view_cnt" integer NOT NULL, "s_type" varchar(2) NOT NULL, "password" varchar(128) NULL, "expire_date" datetime NULL);
CREATE TABLE "share_orgfileshare" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "org_id" integer NOT NULL, "file_share_id" integer NOT NULL UNIQUE REFERENCES "share_fileshare" ("id"));
CREATE TABLE "share_uploadlinkshare" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "username" varchar(255) NOT NULL, "repo_id" varchar(36) NOT NULL, "path" text NOT NULL, "token" varchar(10) NOT NULL UNIQUE, "ctime" datetime NOT NULL, "view_cnt" integer NOT NULL, "password" varchar(128) NULL, "expire_date" datetime NULL);
CREATE TABLE "share_uploadlinkshare" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "username" varchar(255) NOT NULL, "repo_id" varchar(36) NOT NULL, "path" text NOT NULL, "token" varchar(100) NOT NULL UNIQUE, "ctime" datetime NOT NULL, "view_cnt" integer NOT NULL, "password" varchar(128) NULL, "expire_date" datetime NULL);
CREATE TABLE "share_privatefiledirshare" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "from_user" varchar(255) NOT NULL, "to_user" varchar(255) NOT NULL, "repo_id" varchar(36) NOT NULL, "path" text NOT NULL, "token" varchar(10) NOT NULL UNIQUE, "permission" varchar(5) NOT NULL, "s_type" varchar(5) NOT NULL);
CREATE TABLE "sysadmin_extra_userloginlog" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "username" varchar(255) NOT NULL, "login_date" datetime NOT NULL, "login_ip" varchar(128) NOT NULL);
CREATE TABLE "organizations_orgmemberquota" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "org_id" integer NOT NULL, "quota" integer NOT NULL);
CREATE TABLE "admin_log_adminlog" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "email" varchar(254) NOT NULL, "operation" varchar(255) NOT NULL, "detail" text NOT NULL, "datetime" datetime NOT NULL);
CREATE TABLE "captcha_captchastore" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "challenge" varchar(32) NOT NULL, "response" varchar(32) NOT NULL, "hashkey" varchar(40) NOT NULL UNIQUE, "expiration" datetime NOT NULL);
CREATE TABLE "django_content_type" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "app_label" varchar(100) NOT NULL, "model" varchar(100) NOT NULL, UNIQUE ("app_label", "model"));
INSERT INTO "django_content_type" VALUES(1,'contenttypes','contenttype');
@@ -85,35 +85,35 @@ INSERT INTO "django_content_type" VALUES(26,'base','userstarredfiles');
INSERT INTO "django_content_type" VALUES(27,'contacts','contact');
INSERT INTO "django_content_type" VALUES(28,'institutions','institutionadmin');
INSERT INTO "django_content_type" VALUES(29,'institutions','institution');
INSERT INTO "django_content_type" VALUES(30,'invitations','invitation');
INSERT INTO "django_content_type" VALUES(31,'wiki','personalwiki');
INSERT INTO "django_content_type" VALUES(32,'wiki','groupwiki');
INSERT INTO "django_content_type" VALUES(33,'group','publicgroup');
INSERT INTO "django_content_type" VALUES(34,'group','groupmessage');
INSERT INTO "django_content_type" VALUES(35,'group','messageattachment');
INSERT INTO "django_content_type" VALUES(36,'group','messagereply');
INSERT INTO "django_content_type" VALUES(37,'message','usermsgattachment');
INSERT INTO "django_content_type" VALUES(38,'message','usermsglastcheck');
INSERT INTO "django_content_type" VALUES(39,'message','usermessage');
INSERT INTO "django_content_type" VALUES(40,'notifications','notification');
INSERT INTO "django_content_type" VALUES(41,'notifications','usernotification');
INSERT INTO "django_content_type" VALUES(42,'options','useroptions');
INSERT INTO "django_content_type" VALUES(43,'profile','profile');
INSERT INTO "django_content_type" VALUES(44,'profile','detailedprofile');
INSERT INTO "django_content_type" VALUES(45,'share','privatefiledirshare');
INSERT INTO "django_content_type" VALUES(46,'share','uploadlinkshare');
INSERT INTO "django_content_type" VALUES(47,'share','fileshare');
INSERT INTO "django_content_type" VALUES(48,'share','anonymousshare');
INSERT INTO "django_content_type" VALUES(49,'share','orgfileshare');
INSERT INTO "django_content_type" VALUES(50,'sysadmin_extra','userloginlog');
INSERT INTO "django_content_type" VALUES(51,'organizations','orgmemberquota');
INSERT INTO "django_content_type" VALUES(52,'two_factor','phonedevice');
INSERT INTO "django_content_type" VALUES(53,'two_factor','statictoken');
INSERT INTO "django_content_type" VALUES(54,'two_factor','totpdevice');
INSERT INTO "django_content_type" VALUES(55,'two_factor','staticdevice');
INSERT INTO "django_content_type" VALUES(30,'institutions','institutionquota');
INSERT INTO "django_content_type" VALUES(31,'invitations','invitation');
INSERT INTO "django_content_type" VALUES(32,'wiki','personalwiki');
INSERT INTO "django_content_type" VALUES(33,'wiki','groupwiki');
INSERT INTO "django_content_type" VALUES(34,'group','publicgroup');
INSERT INTO "django_content_type" VALUES(35,'group','groupmessage');
INSERT INTO "django_content_type" VALUES(36,'group','messageattachment');
INSERT INTO "django_content_type" VALUES(37,'group','messagereply');
INSERT INTO "django_content_type" VALUES(38,'notifications','notification');
INSERT INTO "django_content_type" VALUES(39,'notifications','usernotification');
INSERT INTO "django_content_type" VALUES(40,'options','useroptions');
INSERT INTO "django_content_type" VALUES(41,'profile','profile');
INSERT INTO "django_content_type" VALUES(42,'profile','detailedprofile');
INSERT INTO "django_content_type" VALUES(43,'share','privatefiledirshare');
INSERT INTO "django_content_type" VALUES(44,'share','uploadlinkshare');
INSERT INTO "django_content_type" VALUES(45,'share','fileshare');
INSERT INTO "django_content_type" VALUES(46,'share','anonymousshare');
INSERT INTO "django_content_type" VALUES(47,'share','orgfileshare');
INSERT INTO "django_content_type" VALUES(48,'admin_log','adminlog');
INSERT INTO "django_content_type" VALUES(49,'sysadmin_extra','userloginlog');
INSERT INTO "django_content_type" VALUES(50,'organizations','orgmemberquota');
INSERT INTO "django_content_type" VALUES(51,'two_factor','phonedevice');
INSERT INTO "django_content_type" VALUES(52,'two_factor','statictoken');
INSERT INTO "django_content_type" VALUES(53,'two_factor','totpdevice');
INSERT INTO "django_content_type" VALUES(54,'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 "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_institutionquota" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "quota" bigint 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_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"));
@@ -128,8 +128,8 @@ CREATE TABLE "two_factor_staticdevice" ("id" integer NOT NULL PRIMARY KEY AUTOIN
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;
INSERT INTO "sqlite_sequence" VALUES('django_migrations',15);
INSERT INTO "sqlite_sequence" VALUES('django_content_type',55);
INSERT INTO "sqlite_sequence" VALUES('django_migrations',17);
INSERT INTO "sqlite_sequence" VALUES('django_content_type',54);
INSERT INTO "sqlite_sequence" VALUES('invitations_invitation',0);
INSERT INTO "sqlite_sequence" VALUES('post_office_email',0);
INSERT INTO "sqlite_sequence" VALUES('post_office_emailtemplate',0);
@@ -151,10 +151,6 @@ CREATE INDEX "group_groupmessage_0e939a4f" ON "group_groupmessage" ("group_id");
CREATE INDEX "group_messagereply_6ec85d95" ON "group_messagereply" ("reply_to_id");
CREATE INDEX "group_messageattachment_06a351d8" ON "group_messageattachment" ("group_message_id");
CREATE INDEX "group_publicgroup_0e939a4f" ON "group_publicgroup" ("group_id");
CREATE INDEX "message_usermessage_f50bd8c4" ON "message_usermessage" ("from_email");
CREATE INDEX "message_usermessage_acc047cf" ON "message_usermessage" ("to_email");
CREATE INDEX "message_usermsgattachment_728fbd7e" ON "message_usermsgattachment" ("user_msg_id");
CREATE INDEX "message_usermsgattachment_4b5c5c38" ON "message_usermsgattachment" ("priv_file_dir_share_id");
CREATE INDEX "notifications_usernotification_86899d6f" ON "notifications_usernotification" ("to_user");
CREATE INDEX "notifications_usernotification_486af403" ON "notifications_usernotification" ("msg_type");
CREATE INDEX "options_useroptions_0c83f57c" ON "options_useroptions" ("email");
@@ -173,7 +169,10 @@ CREATE INDEX "share_privatefiledirshare_9a8c79bf" ON "share_privatefiledirshare"
CREATE INDEX "sysadmin_extra_userloginlog_14c4b06b" ON "sysadmin_extra_userloginlog" ("username");
CREATE INDEX "sysadmin_extra_userloginlog_28ed1ef0" ON "sysadmin_extra_userloginlog" ("login_date");
CREATE INDEX "organizations_orgmemberquota_9cf869aa" ON "organizations_orgmemberquota" ("org_id");
CREATE INDEX "admin_log_adminlog_0c83f57c" ON "admin_log_adminlog" ("email");
CREATE INDEX "admin_log_adminlog_f7235a61" ON "admin_log_adminlog" ("operation");
CREATE INDEX "institutions_institutionadmin_a964baeb" ON "institutions_institutionadmin" ("institution_id");
CREATE INDEX "institutions_institutionquota_a964baeb" ON "institutions_institutionquota" ("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");