Changeset 55 for trunk/data

Show
Ignore:
Timestamp:
12/20/05 11:44:03 (3 years ago)
Author:
fabien
Message:

day 20 modifications

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/data/fixtures/test_data.yml

    r38 r55  
    1111    password:   symfony 
    1212    email:      fp@example.com 
     13    is_administrator: on 
    1314 
    1415  francois: 
  • trunk/data/sql/schema.sql

    r44 r55  
    1616    `html_body` TEXT ,  
    1717    `interested_users` INTEGER default 0 ,  
     18    `reports` INTEGER default 0 ,  
    1819    `created_at` DATETIME ,  
    1920    `updated_at` DATETIME ,   
     
    3839    `relevancy_up` INTEGER default 0 ,  
    3940    `relevancy_down` INTEGER default 0 ,  
     41    `reports` INTEGER default 0 ,  
    4042    `created_at` DATETIME ,   
    4143    PRIMARY KEY(`id`),   
     
    4446      FOREIGN KEY (`question_id`) 
    4547      REFERENCES `ask_question` (`id`) 
    46 ,  
     48      ON DELETE CASCADE,  
    4749    INDEX `ask_answer_FI_2` (`user_id`),  
    4850    CONSTRAINT `ask_answer_FK_2`  
     
    6567    `salt` VARCHAR(32) ,  
    6668    `has_paypal` INTEGER default 0 ,  
     69    `want_to_be_moderator` INTEGER default 0 ,  
     70    `is_moderator` INTEGER default 0 ,  
     71    `is_administrator` INTEGER default 0 ,  
     72    `deletions` INTEGER default 0 ,  
    6773    `created_at` DATETIME ,   
    6874    PRIMARY KEY(`id`)) 
     
    8187      FOREIGN KEY (`question_id`) 
    8288      REFERENCES `ask_question` (`id`) 
    83 ,  
     89      ON DELETE CASCADE,  
    8490    INDEX `ask_interest_FI_2` (`user_id`),  
    8591    CONSTRAINT `ask_interest_FK_2`  
     
    102108      FOREIGN KEY (`answer_id`) 
    103109      REFERENCES `ask_answer` (`id`) 
    104 ,  
     110      ON DELETE CASCADE,  
    105111    INDEX `ask_relevancy_FI_2` (`user_id`),  
    106112    CONSTRAINT `ask_relevancy_FK_2`  
     
    115121 
    116122CREATE TABLE `ask_question_tag`( 
    117     `question_id` INTEGER ,  
    118     `user_id` INTEGER ,  
     123    `question_id` INTEGER NOT NULL ,  
     124    `user_id` INTEGER NOT NULL ,  
    119125    `created_at` DATETIME ,  
    120126    `tag` VARCHAR(100) ,  
    121     `normalized_tag` VARCHAR(100) ,   
    122     UNIQUE KEY `pk` (`question_id`,`user_id`,`normalized_tag`),   
     127    `normalized_tag` VARCHAR(100) NOT NULL ,   
     128    PRIMARY KEY(`question_id`,`user_id`,`normalized_tag`),   
    123129    KEY `normalized_tag_index` (`normalized_tag`),   
    124130    CONSTRAINT `ask_question_tag_FK_1`  
    125131      FOREIGN KEY (`question_id`) 
    126132      REFERENCES `ask_question` (`id`) 
    127 ,  
     133      ON DELETE CASCADE,  
    128134    INDEX `ask_question_tag_FI_2` (`user_id`),  
    129135    CONSTRAINT `ask_question_tag_FK_2`  
     
    132138) 
    133139Type=InnoDB; 
     140# ----------------------------------------------------------------------- 
     141# ask_report_question  
     142# ----------------------------------------------------------------------- 
     143DROP TABLE IF EXISTS `ask_report_question`; 
     144 
     145CREATE TABLE `ask_report_question`( 
     146    `question_id` INTEGER NOT NULL ,  
     147    `user_id` INTEGER NOT NULL ,  
     148    `created_at` DATETIME ,   
     149    PRIMARY KEY(`question_id`,`user_id`),   
     150    CONSTRAINT `ask_report_question_FK_1`  
     151      FOREIGN KEY (`question_id`) 
     152      REFERENCES `ask_question` (`id`) 
     153      ON DELETE CASCADE,  
     154    INDEX `ask_report_question_FI_2` (`user_id`),  
     155    CONSTRAINT `ask_report_question_FK_2`  
     156      FOREIGN KEY (`user_id`) 
     157      REFERENCES `ask_user` (`id`) 
     158) 
     159Type=InnoDB; 
     160# ----------------------------------------------------------------------- 
     161# ask_report_answer  
     162# ----------------------------------------------------------------------- 
     163DROP TABLE IF EXISTS `ask_report_answer`; 
     164 
     165CREATE TABLE `ask_report_answer`( 
     166    `answer_id` INTEGER NOT NULL ,  
     167    `user_id` INTEGER NOT NULL ,  
     168    `created_at` DATETIME ,   
     169    PRIMARY KEY(`answer_id`,`user_id`),   
     170    CONSTRAINT `ask_report_answer_FK_1`  
     171      FOREIGN KEY (`answer_id`) 
     172      REFERENCES `ask_answer` (`id`) 
     173      ON DELETE CASCADE,  
     174    INDEX `ask_report_answer_FI_2` (`user_id`),  
     175    CONSTRAINT `ask_report_answer_FK_2`  
     176      FOREIGN KEY (`user_id`) 
     177      REFERENCES `ask_user` (`id`) 
     178) 
     179Type=InnoDB; 
     180   
     181   
    134182   
    135183