maximozz / solidaria

0 stars 0 forks source link

Create DB table for generator purchase transactions #4

Open maximozz opened 9 years ago

maximozz commented 9 years ago

named custom table 'mozz_gentransactions' make .sql file

1) copied structure from 'mozz_genpackages' table; 2) edited, dropped and added relevant fields and indexes, f.e. ALTER TABLE mozz_gentransactions DROP price, DROP currency ; ALTER TABLE mozz_gentransactions CHANGE type type ENUM( 'FOC', 'DAR', 'EUR' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ; etc. 3) result - table structure CREATE TABLE IF NOT EXISTS mozz_gentransactions ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, type enum('FOC','DAR','EUR') NOT NULL, subtype int(11) DEFAULT NULL, buyer_id bigint(20) unsigned NOT NULL, seller_id bigint(20) unsigned NOT NULL, container_id bigint(20) unsigned NOT NULL, generator_id bigint(20) unsigned NOT NULL, time_purchased int(11) NOT NULL, enabled enum('yes','no') NOT NULL DEFAULT 'yes', PRIMARY KEY (id), KEY type (type), KEY subtype (subtype), KEY container_guid (container_id), KEY time_created (time_purchased), KEY buyer_guid (buyer_id), KEY seller_guid (seller_id), KEY generator_guid (generator_id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;