getting file size for all dict files to be downloaded. coming to be 400mb or so.
[worddb.git] / migrations / 001_django_contrib_auth_models.py
blob564d0055ee7bf258b67833d0dff9a426dab53515
1 from dmigrations.mysql import migrations as m
2 import datetime
3 migration = m.Migration(sql_up=["""
4 CREATE TABLE `auth_permission` (
5 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
6 `name` varchar(50) NOT NULL,
7 `content_type_id` integer NOT NULL,
8 `codename` varchar(100) NOT NULL,
9 UNIQUE (`content_type_id`, `codename`)
10 ) ENGINE=InnoDB DEFAULT CHARSET=utf8
12 """, """
13 CREATE TABLE `auth_group` (
14 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
15 `name` varchar(80) NOT NULL UNIQUE
16 ) ENGINE=InnoDB DEFAULT CHARSET=utf8
18 """, """
19 CREATE TABLE `auth_user` (
20 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
21 `username` varchar(30) NOT NULL UNIQUE,
22 `first_name` varchar(30) NOT NULL,
23 `last_name` varchar(30) NOT NULL,
24 `email` varchar(75) NOT NULL,
25 `password` varchar(128) NOT NULL,
26 `is_staff` bool NOT NULL,
27 `is_active` bool NOT NULL,
28 `is_superuser` bool NOT NULL,
29 `last_login` datetime NOT NULL,
30 `date_joined` datetime NOT NULL
31 ) ENGINE=InnoDB DEFAULT CHARSET=utf8
33 """, """
34 CREATE TABLE `auth_message` (
35 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
36 `user_id` integer NOT NULL,
37 `message` longtext NOT NULL
38 ) ENGINE=InnoDB DEFAULT CHARSET=utf8
40 """, """
41 ALTER TABLE `auth_message` ADD CONSTRAINT user_id_refs_id_650f49a6 FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
42 """, """
43 CREATE TABLE `auth_group_permissions` (
44 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
45 `group_id` integer NOT NULL,
46 `permission_id` integer NOT NULL,
47 UNIQUE (`group_id`, `permission_id`)
48 ) ENGINE=InnoDB DEFAULT CHARSET=utf8
50 """, """
51 ALTER TABLE `auth_group_permissions` ADD CONSTRAINT group_id_refs_id_3cea63fe FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`);
52 """, """
53 ALTER TABLE `auth_group_permissions` ADD CONSTRAINT permission_id_refs_id_5886d21f FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`);
54 """, """
55 CREATE TABLE `auth_user_groups` (
56 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
57 `user_id` integer NOT NULL,
58 `group_id` integer NOT NULL,
59 UNIQUE (`user_id`, `group_id`)
60 ) ENGINE=InnoDB DEFAULT CHARSET=utf8
62 """, """
63 ALTER TABLE `auth_user_groups` ADD CONSTRAINT user_id_refs_id_7ceef80f FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
64 """, """
65 ALTER TABLE `auth_user_groups` ADD CONSTRAINT group_id_refs_id_f116770 FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`);
66 """, """
67 CREATE TABLE `auth_user_user_permissions` (
68 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
69 `user_id` integer NOT NULL,
70 `permission_id` integer NOT NULL,
71 UNIQUE (`user_id`, `permission_id`)
72 ) ENGINE=InnoDB DEFAULT CHARSET=utf8
74 """, """
75 ALTER TABLE `auth_user_user_permissions` ADD CONSTRAINT user_id_refs_id_dfbab7d FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
76 """, """
77 ALTER TABLE `auth_user_user_permissions` ADD CONSTRAINT permission_id_refs_id_67e79cb FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`);
78 """, """
79 -- The following references should be added but depend on non-existent tables:
80 """, """
81 -- ALTER TABLE `auth_permission` ADD CONSTRAINT content_type_id_refs_id_728de91f FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`);
82 """], sql_down=["""
83 DROP TABLE `auth_user_user_permissions`;
84 """, """
85 DROP TABLE `auth_user_groups`;
86 """, """
87 DROP TABLE `auth_group_permissions`;
88 """, """
89 DROP TABLE `auth_message`;
90 """, """
91 DROP TABLE `auth_user`;
92 """, """
93 DROP TABLE `auth_group`;
94 """, """
95 DROP TABLE `auth_permission`;
96 """])