Open maximozz opened 9 years ago
named custom table 'mozz_genpackages' make .sql file
1) copied structure from 'elgg_entities' table 2) edited and added relevant fields and indexes, f.e. ALTER TABLE mozz_genpackages CHANGE type type ENUM( '1/0', '1/3', '2/7', '3/12', '5/23', '10/53', '20/130', '50/400', '100/1000' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , ALTER TABLE mozz_genpackages ADD price DECIMAL( 14, 6 ) NOT NULL AFTER subtype , ALTER TABLE mozz_genpackages ADD currency CHAR( 3 ) NOT NULL AFTER price ,
mozz_genpackages
type
price
subtype
currency
, etc. 3) result - table structure CREATE TABLE IF NOT EXISTS mozz_genpackages ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, type enum('1/0','1/3','2/7','3/12','5/23','10/53','20/130','50/400','100/1000') NOT NULL, subtype int(11) DEFAULT NULL, price decimal(14,6) NOT NULL, currency char(3) NOT NULL, buyer_id bigint(20) unsigned NOT NULL, seller_id bigint(20) unsigned NOT NULL, container_id bigint(20) unsigned NOT NULL, access_id int(11) 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 access_id (access_id), KEY time_created (time_purchased), KEY buyer_guid (buyer_id), KEY seller_guid (seller_id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
id
buyer_id
seller_id
container_id
access_id
time_purchased
enabled
container_guid
time_created
buyer_guid
seller_guid
named custom table 'mozz_genpackages' make .sql file
1) copied structure from 'elgg_entities' table 2) edited and added relevant fields and indexes, f.e. ALTER TABLE
mozz_genpackages
CHANGEtype
type
ENUM( '1/0', '1/3', '2/7', '3/12', '5/23', '10/53', '20/130', '50/400', '100/1000' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , ALTER TABLEmozz_genpackages
ADDprice
DECIMAL( 14, 6 ) NOT NULL AFTERsubtype
, ALTER TABLEmozz_genpackages
ADDcurrency
CHAR( 3 ) NOT NULL AFTERprice
,, etc. 3) result - table structure CREATE TABLE IF NOT EXISTS
mozz_genpackages
(id
bigint(20) unsigned NOT NULL AUTO_INCREMENT,type
enum('1/0','1/3','2/7','3/12','5/23','10/53','20/130','50/400','100/1000') NOT NULL,subtype
int(11) DEFAULT NULL,price
decimal(14,6) NOT NULL,currency
char(3) NOT NULL,buyer_id
bigint(20) unsigned NOT NULL,seller_id
bigint(20) unsigned NOT NULL,container_id
bigint(20) unsigned NOT NULL,access_id
int(11) NOT NULL,time_purchased
int(11) NOT NULL,enabled
enum('yes','no') NOT NULL DEFAULT 'yes', PRIMARY KEY (id
), KEYtype
(type
), KEYsubtype
(subtype
), KEYcontainer_guid
(container_id
), KEYaccess_id
(access_id
), KEYtime_created
(time_purchased
), KEYbuyer_guid
(buyer_id
), KEYseller_guid
(seller_id
) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;