File: 20010126.sql

package info (click to toggle)
gforge 4.5.14-22etch13
  • links: PTS
  • area: main
  • in suites: etch
  • size: 13,004 kB
  • ctags: 11,918
  • sloc: php: 36,047; sql: 29,050; sh: 10,538; perl: 6,496; xml: 3,810; makefile: 341; python: 263; ansic: 256
file content (51 lines) | stat: -rw-r--r-- 1,489 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
-- by: apzen
-- purpose: stuff for project database and vhost maintanance

     CREATE TABLE prdb_dbs (
        dbid SERIAL PRIMARY KEY, 
        group_id INT NOT NULL,
        dbname TEXT NOT NULL,
        dbusername TEXT NOT NULL,
        dbuserpass TEXT NOT NULL,
        requestdate INT NOT NULL,
        dbtype INT NOT NULL,
        created_by INT NOT NULL,
        state INT NOT NULL
    );

    CREATE TABLE prdb_states (

        stateid INT NOT NULL,
        statename TEXT
    );                

	CREATE UNIQUE INDEX idx_prdb_dbname ON prdb_dbs (dbname);

    INSERT INTO prdb_states VALUES ('1', 'Active');
    INSERT INTO prdb_states VALUES ('2', 'Pending Create');
    INSERT INTO prdb_states VALUES ('3', 'Pending Delete');
    INSERT INTO prdb_states VALUES ('4', 'Pending Update');
    INSERT INTO prdb_states VALUES ('5', 'Failed Create'); 
    INSERT INTO prdb_states VALUES ('6', 'Failed Delete');
	INSERT INTO prdb_states VALUES ('7', 'Failed Update');

    CREATE TABLE prdb_types (
        dbtypeid INT PRIMARY KEY,
        dbservername TEXT NOT NULL,
        dbsoftware TEXT NOT NULL
    );
      
   INSERT INTO prdb_types VALUES ('1','pr-db1','mysql');

    CREATE TABLE prweb_vhost (
        vhostid SERIAL PRIMARY KEY, 
        vhost_name TEXT,        
        docdir TEXT,
		cgidir TEXT,	
        group_id INT NOT NULL
    );

   CREATE INDEX idx_vhost_groups ON prweb_vhost (group_id);

   CREATE UNIQUE INDEX idx_vhost_hostnames ON prweb_vhost(vhost_name);