  |
1 | | - | # $Id: oscommerce.sql 1546 2007-03-31 02:21:32Z hpdl $ |
| |
| 1 | + | # $Id: oscommerce.sql 1862 2009-03-06 23:34:07Z hpdl $ |
|
2 | 2 | | # |
| |
3 | 3 | | # osCommerce, Open Source E-Commerce Solutions |
| |
4 | 4 | | # http://www.oscommerce.com |
| |
|
|
 |
… |
|
197 | 197 | | PRIMARY KEY (customers_id) |
| |
198 | 198 | | ); |
| |
199 | 199 | | |
  |
200 | | - | DROP TABLE IF EXISTS osc_customers_basket; |
| |
201 | | - | CREATE TABLE osc_customers_basket ( |
| |
202 | | - | customers_basket_id int NOT NULL auto_increment, |
| |
203 | | - | customers_id int NOT NULL, |
| |
204 | | - | products_id tinytext NOT NULL, |
| |
205 | | - | customers_basket_quantity int NOT NULL, |
| |
206 | | - | final_price decimal(15,4) NOT NULL, |
| |
207 | | - | customers_basket_date_added datetime, |
| |
208 | | - | PRIMARY KEY (customers_basket_id) |
| |
209 | | - | ); |
| |
210 | | - | |
|
211 | 200 | | DROP TABLE IF EXISTS osc_languages; |
| |
212 | 201 | | CREATE TABLE osc_languages ( |
| |
213 | 202 | | languages_id int NOT NULL auto_increment, |
| |
|
|
 |
… |
|
345 | 334 | | products_model varchar(12), |
| |
346 | 335 | | products_name varchar(64) NOT NULL, |
| |
347 | 336 | | products_price decimal(15,4) NOT NULL, |
  |
348 | | - | final_price decimal(15,4) NOT NULL, |
|
349 | 337 | | products_tax decimal(7,4) NOT NULL, |
| |
350 | 338 | | products_quantity int(2) NOT NULL, |
| |
351 | 339 | | PRIMARY KEY (orders_products_id) |
| |
|
|
 |
… |
|
371 | 359 | | PRIMARY KEY (orders_status_history_id) |
| |
372 | 360 | | ); |
| |
373 | 361 | | |
  |
374 | | - | DROP TABLE IF EXISTS osc_orders_products_attributes; |
| |
375 | | - | CREATE TABLE osc_orders_products_attributes ( |
| |
376 | | - | orders_products_attributes_id int NOT NULL auto_increment, |
| |
| 362 | + | DROP TABLE IF EXISTS osc_orders_products_variants; |
| |
| 363 | + | CREATE TABLE osc_orders_products_variants ( |
| |
| 364 | + | id int NOT NULL auto_increment, |
|
377 | 365 | | orders_id int NOT NULL, |
| |
378 | 366 | | orders_products_id int NOT NULL, |
  |
379 | | - | products_options varchar(32) NOT NULL, |
| |
380 | | - | products_options_values varchar(32) NOT NULL, |
| |
381 | | - | options_values_price decimal(15,4) NOT NULL, |
| |
382 | | - | price_prefix char(1) NOT NULL, |
| |
383 | | - | PRIMARY KEY (orders_products_attributes_id) |
| |
| 367 | + | group_title varchar(255) NOT NULL, |
| |
| 368 | + | value_title text NOT NULL, |
| |
| 369 | + | PRIMARY KEY (id), |
| |
| 370 | + | KEY idx_orders_products_variants_orders_products_ids (orders_id, orders_products_id) |
|
384 | 371 | | ); |
| |
385 | 372 | | |
| |
386 | 373 | | DROP TABLE IF EXISTS osc_orders_products_download; |
| |
|
|
 |
… |
|
428 | 415 | | KEY idx_orders_transactions_status_name (status_name) |
| |
429 | 416 | | ); |
| |
430 | 417 | | |
  |
| 418 | + | DROP TABLE IF EXISTS osc_product_attributes; |
| |
| 419 | + | CREATE TABLE osc_product_attributes ( |
| |
| 420 | + | id INT UNSIGNED NOT NULL, |
| |
| 421 | + | products_id INT UNSIGNED NOT NULL, |
| |
| 422 | + | languages_id INT UNSIGNED NOT NULL, |
| |
| 423 | + | value TEXT NOT NULL, |
| |
| 424 | + | KEY idx_pa_id_products_id (id, products_id), |
| |
| 425 | + | KEY idx_pa_languages_id (languages_id) |
| |
| 426 | + | ); |
| |
| 427 | + | |
|
431 | 428 | | DROP TABLE IF EXISTS osc_products; |
| |
432 | 429 | | CREATE TABLE osc_products ( |
| |
433 | 430 | | products_id int NOT NULL auto_increment, |
  |
434 | | - | products_quantity int(4) NOT NULL, |
| |
| 431 | + | parent_id int NOT NULL DEFAULT 0, |
| |
| 432 | + | products_quantity int NOT NULL, |
|
435 | 433 | | products_price decimal(15,4) NOT NULL, |
  |
| 434 | + | products_model varchar(255) NOT NULL, |
|
436 | 435 | | products_date_added datetime NOT NULL, |
| |
437 | 436 | | products_last_modified datetime, |
  |
438 | | - | products_date_available datetime, |
|
439 | 437 | | products_weight decimal(5,2) NOT NULL, |
| |
440 | 438 | | products_weight_class int NOT NULL, |
| |
441 | 439 | | products_status tinyint(1) NOT NULL, |
| |
442 | 440 | | products_tax_class_id int NOT NULL, |
| |
443 | 441 | | manufacturers_id int NULL, |
| |
444 | 442 | | products_ordered int NOT NULL default '0', |
  |
| 443 | + | has_children int default 0, |
|
445 | 444 | | PRIMARY KEY (products_id), |
| |
446 | 445 | | KEY idx_products_date_added (products_date_added) |
| |
447 | 446 | | ); |
| |
448 | 447 | | |
  |
449 | | - | DROP TABLE IF EXISTS osc_products_attributes; |
| |
450 | | - | CREATE TABLE osc_products_attributes ( |
| |
451 | | - | products_attributes_id int NOT NULL auto_increment, |
| |
452 | | - | products_id int NOT NULL, |
| |
453 | | - | options_id int NOT NULL, |
| |
454 | | - | options_values_id int NOT NULL, |
| |
455 | | - | options_values_price decimal(15,4) NOT NULL, |
| |
456 | | - | price_prefix char(1) NOT NULL, |
| |
457 | | - | PRIMARY KEY (products_attributes_id) |
| |
458 | | - | ); |
| |
459 | | - | |
| |
460 | | - | DROP TABLE IF EXISTS osc_products_attributes_download; |
| |
461 | | - | CREATE TABLE osc_products_attributes_download ( |
| |
462 | | - | products_attributes_id int NOT NULL, |
| |
463 | | - | products_attributes_filename varchar(255) NOT NULL default '', |
| |
464 | | - | products_attributes_maxdays int(2) default '0', |
| |
465 | | - | products_attributes_maxcount int(2) default '0', |
| |
466 | | - | PRIMARY KEY (products_attributes_id) |
| |
467 | | - | ); |
| |
468 | | - | |
|
469 | 448 | | DROP TABLE IF EXISTS osc_products_description; |
| |
470 | 449 | | CREATE TABLE osc_products_description ( |
| |
471 | 450 | | products_id int NOT NULL auto_increment, |
| |
472 | 451 | | language_id int NOT NULL default '1', |
| |
473 | 452 | | products_name varchar(64) NOT NULL default '', |
| |
474 | 453 | | products_description text, |
  |
475 | | - | products_model varchar(16), |
|
476 | 454 | | products_keyword varchar(64), |
| |
477 | 455 | | products_tags varchar(255), |
| |
478 | 456 | | products_url varchar(255), |
| |
|
|
 |
… |
|
514 | 492 | | PRIMARY KEY (products_id, customers_id) |
| |
515 | 493 | | ); |
| |
516 | 494 | | |
  |
517 | | - | DROP TABLE IF EXISTS osc_products_options; |
| |
518 | | - | CREATE TABLE osc_products_options ( |
| |
519 | | - | products_options_id int NOT NULL default '0', |
| |
520 | | - | language_id int NOT NULL default '1', |
| |
521 | | - | products_options_name varchar(32) NOT NULL default '', |
| |
522 | | - | PRIMARY KEY (products_options_id,language_id) |
| |
| 495 | + | DROP TABLE IF EXISTS osc_products_to_categories; |
| |
| 496 | + | CREATE TABLE osc_products_to_categories ( |
| |
| 497 | + | products_id int NOT NULL, |
| |
| 498 | + | categories_id int NOT NULL, |
| |
| 499 | + | PRIMARY KEY (products_id,categories_id) |
|
523 | 500 | | ); |
| |
524 | 501 | | |
  |
525 | | - | DROP TABLE IF EXISTS osc_products_options_values; |
| |
526 | | - | CREATE TABLE osc_products_options_values ( |
| |
527 | | - | products_options_values_id int NOT NULL default '0', |
| |
528 | | - | language_id int NOT NULL default '1', |
| |
529 | | - | products_options_values_name varchar(64) NOT NULL default '', |
| |
530 | | - | PRIMARY KEY (products_options_values_id,language_id) |
| |
| 502 | + | DROP TABLE IF EXISTS osc_products_variants; |
| |
| 503 | + | CREATE TABLE osc_products_variants ( |
| |
| 504 | + | products_id INT UNSIGNED NOT NULL, |
| |
| 505 | + | products_variants_values_id INT UNSIGNED NOT NULL, |
| |
| 506 | + | default_combo TINYINT UNSIGNED DEFAULT 0, |
| |
| 507 | + | PRIMARY KEY (products_id, products_variants_values_id) |
|
531 | 508 | | ); |
| |
532 | 509 | | |
  |
533 | | - | DROP TABLE IF EXISTS osc_products_options_values_to_products_options; |
| |
534 | | - | CREATE TABLE osc_products_options_values_to_products_options ( |
| |
535 | | - | products_options_values_to_products_options_id int NOT NULL auto_increment, |
| |
536 | | - | products_options_id int NOT NULL, |
| |
537 | | - | products_options_values_id int NOT NULL, |
| |
538 | | - | PRIMARY KEY (products_options_values_to_products_options_id) |
| |
| 510 | + | DROP TABLE IF EXISTS osc_products_variants_groups; |
| |
| 511 | + | CREATE TABLE osc_products_variants_groups ( |
| |
| 512 | + | id int NOT NULL auto_increment, |
| |
| 513 | + | languages_id int NOT NULL, |
| |
| 514 | + | title varchar(255) NOT NULL, |
| |
| 515 | + | sort_order int NOT NULL, |
| |
| 516 | + | module varchar(255) NOT NULL, |
| |
| 517 | + | PRIMARY KEY (id, languages_id) |
|
539 | 518 | | ); |
| |
540 | 519 | | |
  |
541 | | - | DROP TABLE IF EXISTS osc_products_to_categories; |
| |
542 | | - | CREATE TABLE osc_products_to_categories ( |
| |
543 | | - | products_id int NOT NULL, |
| |
544 | | - | categories_id int NOT NULL, |
| |
545 | | - | PRIMARY KEY (products_id,categories_id) |
| |
| 520 | + | DROP TABLE IF EXISTS osc_products_variants_values; |
| |
| 521 | + | CREATE TABLE osc_products_variants_values ( |
| |
| 522 | + | id int NOT NULL auto_increment, |
| |
| 523 | + | languages_id int NOT NULL, |
| |
| 524 | + | products_variants_groups_id int NOT NULL, |
| |
| 525 | + | title varchar(255) NOT NULL, |
| |
| 526 | + | sort_order int NOT NULL, |
| |
| 527 | + | PRIMARY KEY (id, languages_id), |
| |
| 528 | + | KEY idx_products_variants_values_groups_id (products_variants_groups_id) |
|
546 | 529 | | ); |
| |
547 | 530 | | |
| |
548 | 531 | | DROP TABLE IF EXISTS osc_reviews; |
| |
|
|
 |
… |
|
569 | 552 | | PRIMARY KEY (sesskey) |
| |
570 | 553 | | ); |
| |
571 | 554 | | |
  |
| 555 | + | DROP TABLE IF EXISTS osc_shipping_availability; |
| |
| 556 | + | CREATE TABLE osc_shipping_availability ( |
| |
| 557 | + | id INT UNSIGNED NOT NULL, |
| |
| 558 | + | languages_id INT UNSIGNED NOT NULL, |
| |
| 559 | + | title varchar(255) NOT NULL, |
| |
| 560 | + | css_key varchar(255), |
| |
| 561 | + | PRIMARY KEY (id, languages_id) |
| |
| 562 | + | ); |
| |
| 563 | + | |
| |
| 564 | + | DROP TABLE IF EXISTS osc_shopping_carts; |
| |
| 565 | + | CREATE TABLE osc_shopping_carts ( |
| |
| 566 | + | customers_id INT UNSIGNED NOT NULL, |
| |
| 567 | + | item_id SMALLINT UNSIGNED NOT NULL, |
| |
| 568 | + | products_id INT UNSIGNED NOT NULL, |
| |
| 569 | + | quantity SMALLINT UNSIGNED NOT NULL, |
| |
| 570 | + | date_added DATETIME, |
| |
| 571 | + | KEY idx_sc_customers_id (customers_id), |
| |
| 572 | + | KEY idx_sc_customers_id_products_id (customers_id, products_id) |
| |
| 573 | + | ); |
| |
| 574 | + | |
| |
| 575 | + | DROP TABLE IF EXISTS osc_shopping_carts_custom_variants_values; |
| |
| 576 | + | CREATE TABLE osc_shopping_carts_custom_variants_values ( |
| |
| 577 | + | shopping_carts_item_id SMALLINT UNSIGNED NOT NULL, |
| |
| 578 | + | customers_id INT UNSIGNED NOT NULL, |
| |
| 579 | + | products_id INT UNSIGNED NOT NULL, |
| |
| 580 | + | products_variants_values_id INT UNSIGNED NOT NULL, |
| |
| 581 | + | products_variants_values_text TEXT NOT NULL, |
| |
| 582 | + | KEY idx_sccvv_customers_id_products_id (customers_id, products_id) |
| |
| 583 | + | ); |
| |
| 584 | + | |
|
572 | 585 | | DROP TABLE IF EXISTS osc_specials; |
| |
573 | 586 | | CREATE TABLE osc_specials ( |
| |
574 | 587 | | specials_id int NOT NULL auto_increment, |
| |
|
|
 |
… |
|
704 | 717 | | INSERT INTO osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('E-Mail Address', 'STORE_OWNER_EMAIL_ADDRESS', 'root@localhost', 'The e-mail address of my store owner', '1', '3', now()); |
| |
705 | 718 | | INSERT INTO osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('E-Mail From', 'EMAIL_FROM', '"Store Owner" <root@localhost>', 'The e-mail address used in (sent) e-mails', '1', '4', now()); |
| |
706 | 719 | | INSERT INTO osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) VALUES ('Country', 'STORE_COUNTRY', '223', 'The country my store is located in <br><br><b>Note: Please remember to update the store zone.</b>', '1', '6', 'osC_Address::getCountryName', 'osc_cfg_set_countries_pulldown_menu', now()); |
  |
707 | | - | INSERT INTO osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) VALUES ('Zone', 'STORE_ZONE', '', 'The zone my store is located in', '1', '7', 'osC_Address::getZoneName', 'osc_cfg_set_zones_pulldown_menu', now()); |
| |
| 720 | + | INSERT INTO osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) VALUES ('Zone', 'STORE_ZONE', '4031', 'The zone my store is located in', '1', '7', 'osC_Address::getZoneName', 'osc_cfg_set_zones_pulldown_menu', now()); |
|
708 | 721 | | INSERT INTO osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Send Extra Order Emails To', 'SEND_EXTRA_ORDER_EMAILS_TO', '', 'Send extra order emails to the following email addresses, in this format: Name 1 <email@address1>, Name 2 <email@address2>', '1', '11', now()); |
| |
709 | 722 | | INSERT INTO osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) VALUES ('Allow Guest To Tell A Friend', 'ALLOW_GUEST_TO_TELL_A_FRIEND', '-1', 'Allow guests to tell a friend about a product', '1', '15', 'osc_cfg_use_get_boolean_value', 'osc_cfg_set_boolean_value(array(1, -1))', now()); |
| |
710 | 723 | | INSERT INTO osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Store Address and Phone', 'STORE_NAME_ADDRESS', 'Store Name\nAddress\nCountry\nPhone', 'This is the Store Name, Address and Phone used on printable documents and displayed online', '1', '18', 'osc_cfg_set_textarea_field', now()); |
| |
|
|
 |
… |
|
5782 | 5795 | | # USA/Florida |
| |
5783 | 5796 | | INSERT INTO osc_tax_rates VALUES (1, 1, 1, 1, 7.0, 'FL TAX 7.0%', now(), now()); |
| |
5784 | 5797 | | INSERT INTO osc_geo_zones (geo_zone_id,geo_zone_name,geo_zone_description,date_added) VALUES (1,"Florida","Florida local sales tax zone",now()); |
  |
5785 | | - | INSERT INTO osc_zones_to_geo_zones (association_id,zone_country_id,zone_id,geo_zone_id,date_added) VALUES (1,223,176,1,now()); |
| |
| 5798 | + | INSERT INTO osc_zones_to_geo_zones (association_id,zone_country_id,zone_id,geo_zone_id,date_added) VALUES (1,223,4031,1,now()); |
  |
5786 | 5799 | | |
| |
5787 | 5800 | | # Templates |
| |
5788 | 5801 | | |