Changeset 1396


Ignore:
Timestamp:
Jan 1, 2014, 3:08:00 PM (4 years ago)
Author:
cmrgsvnsync
Message:

first pass at a new proposal type object

Location:
trunk/jpdd
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/jpdd/class.jpdd.php

    r1388 r1396  
    1919                                                'filename' => 'class.jpdd.workshop.php',
    2020                                                'table' => 'workshop',
     21                                                'limit' => 'event',
     22                                                'sort' => 'title'));
     23      $this->addClassMapEntry('proposal', array('classname' => 'JPDD_Proposal',
     24                                                'filename' => 'class.jpdd.proposal.php',
     25                                                'table' => 'proposal',
    2126                                                'limit' => 'event',
    2227                                                'sort' => 'title'));
  • trunk/jpdd/sql/db.sql

    r1371 r1396  
    977977-- is needed:
    978978
    979 DROP VIEW pommo_import IF EXISTS;
     979DROP VIEW IF EXISTS pommo_import;
    980980
    981981CREATE OR REPLACE VIEW pommo_import AS SELECT first_name, middle_name,
     
    10411041ALTER TABLE event ALTER COLUMN start_planning SET NOT NULL;
    10421042ALTER TABLE event ADD CONSTRAINT event_plan_before_start CHECK (start_planning <= start_time);
     1043
     1044CREATE TABLE proposal (
     1045    id serial PRIMARY KEY,
     1046    event_id int NOT NULL REFERENCES event(id),
     1047    title character varying NOT NULL,
     1048    short_title character varying(35),
     1049    description text,
     1050    min_attendees integer DEFAULT 5 NOT NULL,
     1051    max_attendees integer DEFAULT 25 NOT NULL,
     1052    private_notes text,
     1053    CONSTRAINT proposal_check CHECK (((char_length((title)::text) <= 35) OR (short_title IS NOT NULL))),
     1054    CONSTRAINT proposal_check1 CHECK ((max_attendees >= min_attendees)),
     1055    CONSTRAINT proposal_min_attendees_check CHECK ((min_attendees >= 0)),
     1056    CONSTRAINT proposal_title_check CHECK (((title)::text <> ''::text))
     1057);
     1058
     1059CREATE TABLE proposal_category (
     1060    proposal_id integer NOT NULL REFERENCES proposal(id),
     1061    category_id integer NOT NULL REFERENCES category(id)
     1062);
Note: See TracChangeset for help on using the changeset viewer.