-
Notifications
You must be signed in to change notification settings - Fork 2
/
enable.php
163 lines (150 loc) · 5.5 KB
/
enable.php
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?php
/*
* @author Chris Earls <[email protected]>
* @version 1.0.0
* @since Frog version 0.9.5
* @license http://www.gnu.org/licenses/agpl.html AGPL License
* @copyright Chris Earls, 2009
*/
$PDO = Record::getConnection();
$driver = strtolower($PDO->getAttribute(Record::ATTR_DRIVER_NAME));
if ($driver == mysql)
{
$PDO->exec("
CREATE TABLE ecommerce_collection (
id int(11) NOT NULL auto_increment PRIMARY KEY,
title varchar(100) NOT NULL,
created_on timestamp NULL default CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE ecommerce_log (
id int(11) NOT NULL auto_increment PRIMARY KEY,
message varchar(255) NOT NULL,
user_id int(11) default NULL,
created_on timestamp NULL default CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE ecommerce_order (
id int(11) NOT NULL auto_increment PRIMARY KEY,
first_name varchar(50) NOT NULL,
last_name varchar(50) NOT NULL,
company varchar(50) NOT NULL,
address varchar(50) NOT NULL,
address2 varchar(50) NOT NULL,
city varchar(50) NOT NULL,
state varchar(50) NOT NULL,
zip varchar(50) NOT NULL,
country varchar(50) NOT NULL,
email varchar(50) NOT NULL,
phone varchar(50) NOT NULL,
fax varchar(50) NOT NULL,
ship_first_name varchar(50) NOT NULL,
ship_last_name varchar(50) NOT NULL,
ship_company varchar(50) NOT NULL,
ship_address varchar(50) NOT NULL,
ship_address2 varchar(50) NOT NULL,
ship_city varchar(50) NOT NULL,
ship_state varchar(50) NOT NULL,
ship_zip varchar(50) NOT NULL,
ship_country varchar(50) NOT NULL,
ship_phone varchar(50) NOT NULL,
subtotal decimal(10,2) NOT NULL,
shipping decimal(10,2) NOT NULL,
tax decimal(10,2) NOT NULL,
promo_code varchar(25) NOT NULL,
promo_discount decimal(10,2) NOT NULL,
cc_name varchar(50) NOT NULL,
cc_type varchar(25) NOT NULL,
cc_number varchar(4) NOT NULL,
cc_cvv varchar(4) NOT NULL,
cc_exp_month varchar(2) NOT NULL,
cc_exp_year varchar(4) NOT NULL,
created_on timestamp NULL default CURRENT_TIMESTAMP,
fulfilled tinyint(1) NOT NULL default 0
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1000 ;
CREATE TABLE ecommerce_order_variant (
id int(11) NOT NULL auto_increment PRIMARY KEY,
order_id int(11) NOT NULL,
product_id int(11) NOT NULL,
title varchar(100) NOT NULL,
sku varchar(100) default NULL,
quantity int(11) default NULL,
price decimal(10,2) NOT NULL,
weight int(11) default NULL,
description varchar(255) NOT NULL,
created_on timestamp NULL default CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE ecommerce_product (
id int(11) NOT NULL auto_increment PRIMARY KEY,
title varchar(255) NOT NULL,
slug varchar(100) NOT NULL,
description text,
type_id int(11) default NULL,
vendor_id int(11) default NULL,
is_published tinyint(1) unsigned NOT NULL default 1,
created_on timestamp NOT NULL default CURRENT_TIMESTAMP,
updated_on datetime NOT NULL,
page_id int(11) NOT NULL,
tags text
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE ecommerce_product_collection (
id int(11) NOT NULL auto_increment PRIMARY KEY,
product_id int(11) NOT NULL,
collection_id int(11) NOT NULL,
position int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE ecommerce_product_file (
id int(11) NOT NULL auto_increment PRIMARY KEY,
product_id int(11) NOT NULL,
title varchar(50) NOT NULL,
filename varchar(255) default NULL,
position int(11) default NULL,
created_on timestamp NULL default CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE ecommerce_product_image (
id int(11) NOT NULL auto_increment PRIMARY KEY,
product_id int(11) NOT NULL,
filename varchar(255) default NULL,
position int(11) default NULL,
created_on timestamp NULL default CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE ecommerce_product_type (
id int(11) NOT NULL auto_increment PRIMARY KEY,
title varchar(100) NOT NULL,
created_on timestamp NULL default CURRENT_TIMESTAMP,
slug varchar(100) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE ecommerce_product_variant (
id int(11) NOT NULL auto_increment PRIMARY KEY,
product_id int(11) NOT NULL,
title varchar(255) NOT NULL,
sku varchar(100) default NULL,
quantity int(11) default NULL,
price decimal(10,2) NOT NULL,
weight int(11) default NULL,
created_on timestamp NULL default CURRENT_TIMESTAMP,
updated_on timestamp NULL default NULL,
position int(11) default NULL,
description varchar(255) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE ecommerce_product_vendor (
id int(11) NOT NULL auto_increment PRIMARY KEY,
title varchar(100) NOT NULL,
created_on timestamp NULL default CURRENT_TIMESTAMP,
slug varchar(100) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE ecommerce_product_video (
id int(11) NOT NULL auto_increment PRIMARY KEY,
product_id int(11) NOT NULL,
title varchar(50) NOT NULL,
filename varchar(255) default NULL,
position int(11) default NULL,
created_on timestamp NULL default CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE ecommerce_promos (
id int(11) NOT NULL auto_increment PRIMARY KEY,
code varchar(25) NOT NULL,
start_date datetime NOT NULL,
end_date datetime NOT NULL,
discount smallint(6) NOT NULL,
is_percent tinyint(4) unsigned NOT NULL default 0
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;");
}