Changeset 86


Ignore:
Timestamp:
03/08/11 23:08:25 (14 years ago)
Author:
Kris Deugau
Message:

/trunk

Tweak initial SQL definitions further so it actually works out of the box

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.sql

    r85 r86  
    4949
    5050-- Provide a basic default group
    51 COPY groups (group_id, parent_group_id, group_name) FROM stdin;
     51COPY groups (group_id, parent_group_id, permission_id, group_name) FROM stdin;
    52521       1       1       default
    5353\.
     
    7979    record_edit boolean DEFAULT false NOT NULL,
    8080    record_delete boolean DEFAULT false NOT NULL,
    81     user_id integer DEFAULT 0 NOT NULL,
    82     group_id integer DEFAULT 0 NOT NULL
     81    user_id integer UNIQUE,
     82    group_id integer UNIQUE
    8383);
    8484
    8585-- Need *two* basic permissions;  one for the initial group, one for the default admin user
    86 COPY permissions (permission_id, admin, self_edit, group_create, group_edit group_delete, user_create, user_edit, user_delete, domain_create, domain_edit, domain_delete, record_create, record_edit, record_delete) FROM stdin;
    87 1       n       n       n       n       n       n       n       n       n       n       n       n       n       n
    88 2       y       n       n       n       n       n       n       n       n       n       n       n       n       n
     86COPY permissions (permission_id, admin, self_edit, group_create, group_edit, group_delete, user_create, user_edit, user_delete, domain_create, domain_edit, domain_delete, record_create, record_edit, record_delete, user_id, group_id) FROM stdin;
     871       f       f       f       f       f       f       f       f       f       f       f       f       f       f       \N      1
     882       t       f       f       f       f       f       f       f       f       f       f       f       f       f       1       \N
    8989\.
    9090
     
    195195
    196196-- create initial default user?  may be better to create an "initialize" script or something
    197 COPY users (user_id, group_id, username, "password", firstname, lastname, phone, "type", status, acl) FROM stdin;
    198 1       1       test@test       $1$BByge8u2$48AaGX3YeHplfErX5Tlqa1      \N      \N      \N      S       1       A       2
     197COPY users (user_id, group_id, username, "password", firstname, lastname, phone, "type", status, permission_id, inherit_perm) FROM stdin;
     1981       1       test@test       $1$BByge8u2$48AaGX3YeHplfErX5Tlqa1      \N      \N      \N      S       1       2       f
    199199\.
    200200
     
    247247ALTER TABLE ONLY groups
    248248    ADD CONSTRAINT group_parent FOREIGN KEY (parent_group_id) REFERENCES groups(group_id);
     249
     250-- set starting sequence numbers, since we've inserted data before they're active
     251SELECT pg_catalog.setval('default_records_record_id_seq', 8, true);
     252SELECT pg_catalog.setval('domains_domain_id_seq', 1, false);
     253SELECT pg_catalog.setval('groups_group_id_seq', 2, true);
     254SELECT pg_catalog.setval('permissions_permission_id_seq', 3, true);
     255SELECT pg_catalog.setval('records_record_id_seq', 1, false);
     256SELECT pg_catalog.setval('users_user_id_seq', 2, false);
Note: See TracChangeset for help on using the changeset viewer.