source: contrib/davical/dba/base-data.sql @ 3733

Revision 3733, 2.2 KB checked in by gabriel.malheiros, 13 years ago (diff)

Ticket #1541 - <Davical customizado para o Expresso.Utiliza Caldav e CardDav?>

Line 
1-- Some sample data to prime the database...
2
3-- FIXME: Only insert the rows if they are not there already.
4INSERT INTO roles ( role_no, role_name ) VALUES( 1, 'Admin');
5INSERT INTO roles ( role_no, role_name ) VALUES( 2, 'Group');
6INSERT INTO roles ( role_no, role_name ) VALUES( 3, 'Public');
7INSERT INTO roles ( role_no, role_name ) VALUES( 4, 'Resource');
8
9-- Set the insert sequence to the next number, with a minimum of 10
10SELECT setval('roles_role_no_seq', (SELECT 10 UNION SELECT role_no FROM roles ORDER BY 1 DESC LIMIT 1) );
11
12INSERT INTO usr ( user_no, active, email_ok, updated, username, password, fullname, email )
13    VALUES ( 1, TRUE, current_date, current_date, 'admin', '**nimda', 'DAViCal Administrator', 'calendars@example.net' );
14
15INSERT INTO role_member (user_no, role_no) VALUES(1, 1);
16
17-- Set the insert sequence to the next number, with a minimum of 1000
18SELECT setval('usr_user_no_seq', (SELECT 1000 UNION SELECT user_no FROM usr ORDER BY 1 DESC LIMIT 1) );
19
20INSERT INTO relationship_type ( rt_id, rt_name, confers, bit_confers )
21    VALUES( 1, 'Administers', 'A', privilege_to_bits('DAV::all') );
22
23INSERT INTO relationship_type ( rt_id, rt_name, confers, bit_confers )
24    VALUES( 2, 'Can read/write to', 'RW', privilege_to_bits( ARRAY['DAV::read','DAV::write']) );
25
26INSERT INTO relationship_type ( rt_id, rt_name, confers, bit_confers )
27    VALUES( 3, 'Can read from', 'R', privilege_to_bits( 'DAV::read') );
28
29INSERT INTO relationship_type ( rt_id, rt_name, confers, bit_confers )
30    VALUES( 4, 'Can see free/busy time of', 'F', privilege_to_bits( 'caldav:read-free-busy') );
31
32INSERT INTO principal_type (principal_type_id, principal_type_desc) VALUES( 1, 'Person' );
33INSERT INTO principal_type (principal_type_id, principal_type_desc) VALUES( 2, 'Resource' );
34INSERT INTO principal_type (principal_type_id, principal_type_desc) VALUES( 3, 'Group' );
35
36INSERT INTO principal ( type_id, user_no, displayname, default_privileges )
37    VALUES ( 1, 1, 'DAViCal Administrator', 0::BIT(24) );
38
39-- Set the insert sequence to the next number, with a minimum of 1000
40SELECT setval('relationship_type_rt_id_seq', (SELECT 10 UNION SELECT rt_id FROM relationship_type ORDER BY 1 DESC LIMIT 1) );
41
Note: See TracBrowser for help on using the repository browser.