|
Para criar as tabelas no PostgreSql para utilizar o calendário e o captcha, execute os seguintes creates: CREATE TYPE cond AS ENUM ( 'PUBLIC', 'PRIVATE', 'DEPT' );
CREATE TYPE ocupation AS ENUM ( 'MEETING', 'BUSY', 'TRIP', 'TEMP' );
CREATE TYPE res AS ENUM ( 'YES', 'NO' );
CREATE TYPE resposta AS ENUM ( 'C', 'U', 'D' );
CREATE TYPE stat AS ENUM ( 'A', 'P', 'U' );
CREATE TABLE displayed ( fk_event integer NOT NULL DEFAULT 0, username character varying(32) NOT NULL DEFAULT ''::character varying, CONSTRAINT displayed_pkey PRIMARY KEY (fk_event, username) ) WITH (OIDS=FALSE); ALTER TABLE displayed OWNER TO postgres;
CREATE TABLE error_login ( users character varying(15) NOT NULL, id serial NOT NULL, date timestamp with time zone DEFAULT now(), ip character varying(18), count_attempts character varying(5) ) WITH (OIDS=FALSE); ALTER TABLE error_login OWNER TO postgres;
CREATE TABLE events ( id integer NOT NULL, subject character varying(128) DEFAULT NULL::character varying, "location" character varying(128) DEFAULT NULL::character varying, event_start integer, event_end integer, isallday character varying(5) NOT NULL DEFAULT 'NO'::character varying, notime character varying(5) NOT NULL DEFAULT 'NO'::character varying, istask character varying(5) NOT NULL DEFAULT 'NO'::character varying, isholiday character varying(5) NOT NULL DEFAULT 'NO'::character varying, isalarm character varying(5) NOT NULL DEFAULT 'NO'::character varying, alarmbeforeminutes integer, priority smallint DEFAULT (5)::smallint, created_on integer, last_modified_on integer, comments text, classification character varying(15) DEFAULT 'BUSY'::character varying, eventfrom character varying(32) NOT NULL DEFAULT ''::character varying, "domain" character varying(20) NOT NULL DEFAULT 'PRIVATE'::character varying, dept integer NOT NULL DEFAULT 0, status character varying(2) NOT NULL DEFAULT 'P'::character varying, is_mail_notified character varying(32), CONSTRAINT events_pkey PRIMARY KEY (id) ) WITH (OIDS=FALSE); ALTER TABLE events OWNER TO postgres;
-- Index: end_idx
-- DROP INDEX end_idx;
CREATE INDEX end_idx ON events USING btree (event_end);
-- Index: isholiday_idx
-- DROP INDEX isholiday_idx;
CREATE INDEX isholiday_idx ON events USING btree (isholiday);
-- Index: istask_idx
-- DROP INDEX istask_idx;
CREATE INDEX istask_idx ON events USING btree (istask);
-- Index: start_idx
-- DROP INDEX start_idx;
CREATE INDEX start_idx ON events USING btree (event_start);
CREATE TABLE events_seq ( id serial NOT NULL, CONSTRAINT events_seq_pkey PRIMARY KEY (id) ) WITH (OIDS=FALSE); ALTER TABLE events_seq OWNER TO postgres;
CREATE TABLE files ( fk_event integer NOT NULL DEFAULT 0, file_name character varying(255) NOT NULL DEFAULT ''::character varying, content_type character varying(64) NOT NULL DEFAULT ''::character varying, file_raw bytea NOT NULL ) WITH (OIDS=FALSE); ALTER TABLE files OWNER TO postgres;
-- Table: members
-- DROP TABLE members;
CREATE TABLE members ( username name NOT NULL DEFAULT ''::bpchar, fk_event integer NOT NULL DEFAULT 0, response resposta NOT NULL DEFAULT 'U'::resposta ) WITH (OIDS=FALSE); ALTER TABLE members OWNER TO postgres;
-- Table: users
-- DROP TABLE users;
CREATE TABLE users ( username character(32) NOT NULL DEFAULT ''::bpchar, "level" integer NOT NULL DEFAULT 0, department integer NOT NULL DEFAULT 0, CONSTRAINT users_pkey PRIMARY KEY (username) ) WITH (OIDS=FALSE); ALTER TABLE users OWNER TO postgres; CREATE TABLE users_email ( id serial NOT NULL, "name" character varying(26) ) WITH (OIDS=FALSE); ALTER TABLE users_email OWNER TO postgres; COMMENT ON TABLE users_email IS 'Tabela que contém todos os usuários do webmail'; INSERT INTO members ( username , fk_event , response ) VALUES ('', '0', 'D'); INSERT INTO events_seq values (1); |