othauth mssql

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

othauth mssql

rgarro@gmail.com

Im using cake with mssql, im not a mssql fan and
took me a while to figure out the right sintax for the table
creation, so im posting it with the hope that could be useful for
somebody else.


$sql = "CREATE TABLE [prospectzone] (
        [id] Integer Identity(0,1) NOT NULL,
        [first_name] Varchar(75) NOT NULL ,
  [last_name] Varchar(55) NOT NULL ,
                [contact_time] Varchar(55) NULL ,
                [email]Varchar(100) NOT NULL ,
                [phone]Varchar(50) NOT NULL,
  [phone2]Varchar(50) NULL,
  [address_1_city] Varchar(55) NOT NULL ,
  [address_1_state] Varchar(55) NOT NULL ,
  [address_1_street1] Varchar(225) NOT NULL ,
  [address_1_street2] Varchar(225) NULL ,
  [address_1_zip] Varchar(25) NOT NULL ,
  [insured_1_dobMM] Varchar(10) NOT NULL ,
  [insured_1_dobDD] Varchar(10) NOT NULL ,
  [insured_1_dobYYYY] Varchar(15) NOT NULL ,
  [insured_1_gender] Varchar(10) NOT NULL ,
  [insured_1_heightFT] Varchar(10) NOT NULL ,
  [insured_1_heightIN] Varchar(10) NOT NULL ,
  [insured_1_health_conditions_detail] Varchar(250) NOT NULL ,
  [insured_1_current_medications_detail] Varchar(250) NOT NULL ,
  [insured_1_smoker] Varchar(15) NOT NULL ,
  [insured_1_weight] Varchar(15) NOT NULL ,
  [ip_address] Varchar(40) NOT NULL ,
  [question_felony] Varchar(50) NOT NULL ,
  [question_hazardous_occupation] Varchar(30) NOT NULL ,
  [question_licensed_pilot] Varchar(30) NOT NULL ,
  [question_dui] Varchar(30) NOT NULL ,
  [insured_1_tobacco_use] Varchar(30) NOT NULL ,
  [insured_1_coverage_amount] Varchar(15)NOT NULL ,
  [insured_1_term_length] Varchar(18) NOT NULL ,
  [insured_1_health_class] Varchar(35) NOT NULL ,
  [datatime_post] datetime NOT NULL,
  [response] Varchar(245) NULL ,
                [callrep] Varchar(24) NULL ,
                [screener] Varchar(24) NULL ,
                [processor]Varchar(24) NULL ,
                [leadid]Varchar(25) NULL ,
                [healthclasi]Varchar(75) NULL ,
                [typeinsur]Varchar(245) NULL ,
                [hhincome]Varchar(50) NULL ,
                [smokefreq]Varchar(50) NULL ,
                [smokebrand]Varchar(50) NULL ,
                [insured_1_health_conditions_detail_other]Varchar(50) NULL ,
                [healthfamiliyhis]Varchar(245) NULL ,
                [healthfamiliyhis_other]Varchar(245) NULL ,
                [homeowner]Varchar(24) NULL ,
                [freequote]Varchar(24) NULL ,
                [haveten]Varchar(24) NULL ,
                [wantquote]Varchar(24) NULL ,
        Primary Key ([id])
        )";


CREATE TABLE [groups] (
  [id] Integer Identity(0,1) NOT NULL,
  [name] Varchar(50) NOT NULL ,
  [created] datetime NOT NULL default '0000-00-00 00:00:00',
  [modified] datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  ([id])
);

CREATE TABLE [groups_permissions] (
  [group_id] int NOT NULL default '0',
  [permission_id] int NOT NULL default '0'
);

CREATE INDEX group_id ON groups_permissions (group_id,permission_id);


CREATE TABLE [permissions] (
  [id] Integer Identity(0,1) NOT NULL,
  [name] Varchar(50) NOT NULL ,
  [created] datetime NOT NULL default '0000-00-00 00:00:00',
  [modified] datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  ([id])
);

CREATE INDEX name ON permissions (name);

CREATE TABLE [users] (
  [id] Integer Identity(0,1) NOT NULL,
  [username] varchar(50) NOT NULL default '',
  [password] varchar(32) NOT NULL default '',
  [name] varchar(50) NOT NULL default '',
  [email] varchar(100) NOT NULL default '',
  [last_visit] datetime NOT NULL default '0000-00-00 00:00:00',
  [group_id] int NOT NULL default '0',
  [active] int NOT NULL default '0',
  [created] datetime NOT NULL default '0000-00-00 00:00:00',
  [modified] datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  ([id])
);

CREATE INDEX group_id ON users (group_id);
CREATE UNIQUE INDEX username ON users (username);
CREATE UNIQUE INDEX email ON users (email,username);


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---