Skip to content

Commit 12fddee

Browse files
committed
Add tables defined in django.contrib.(auth|contenttypes)
1 parent 7e3d0f3 commit 12fddee

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
-- Create Django auth models needed to satisfy tests/integration/models/model_test.py
2+
3+
BEGIN;
4+
--
5+
-- Create model ContentType
6+
--
7+
CREATE TABLE profiles.django_content_type (id integer NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, app_label varchar(100) NOT NULL, model varchar(100) NOT NULL);
8+
--
9+
-- Alter unique_together for contenttype (1 constraint(s))
10+
--
11+
ALTER TABLE profiles.django_content_type ADD CONSTRAINT django_content_type_app_label_model_76bd3d3b_uniq UNIQUE (app_label, model);
12+
13+
--
14+
-- Create model Permission
15+
--
16+
CREATE TABLE profiles.auth_permission (id integer NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, name varchar(255) NOT NULL, content_type_id integer NOT NULL, codename varchar(100) NOT NULL);
17+
18+
--
19+
-- Create model Group
20+
--
21+
CREATE TABLE profiles.auth_group (id integer NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, name varchar(150) NOT NULL UNIQUE);
22+
CREATE TABLE profiles.auth_group_permissions (id integer NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, group_id integer NOT NULL, permission_id integer NOT NULL);
23+
24+
ALTER TABLE profiles.auth_permission ADD CONSTRAINT auth_permission_content_type_id_codename_01ab375a_uniq UNIQUE (content_type_id, codename);
25+
ALTER TABLE profiles.auth_permission ADD CONSTRAINT auth_permission_content_type_id_2f476e4b_fk_django_co FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) DEFERRABLE INITIALLY DEFERRED;
26+
CREATE INDEX auth_permission_content_type_id_2f476e4b ON auth_permission (content_type_id);
27+
CREATE INDEX auth_group_name_a6ea08ec_like ON auth_group (name varchar_pattern_ops);
28+
ALTER TABLE profiles.auth_group_permissions ADD CONSTRAINT auth_group_permissions_group_id_permission_id_0cd325b0_uniq UNIQUE (group_id, permission_id);
29+
ALTER TABLE profiles.auth_group_permissions ADD CONSTRAINT auth_group_permissions_group_id_b120cbf9_fk_auth_group_id FOREIGN KEY (group_id) REFERENCES auth_group (id) DEFERRABLE INITIALLY DEFERRED;
30+
ALTER TABLE profiles.auth_group_permissions ADD CONSTRAINT auth_group_permissio_permission_id_84c5c92e_fk_auth_perm FOREIGN KEY (permission_id) REFERENCES auth_permission (id) DEFERRABLE INITIALLY DEFERRED;
31+
CREATE INDEX auth_group_permissions_group_id_b120cbf9 ON auth_group_permissions (group_id);
32+
CREATE INDEX auth_group_permissions_permission_id_84c5c92e ON auth_group_permissions (permission_id);
33+
COMMIT;

0 commit comments

Comments
 (0)