mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-12 15:49:28 -08:00
* Added privilege level start/end columns Added 2 new columns to the users table to indicate when a users privilege level date / time was recognised and when the privilege level should end. * Updated database header Always forget about the database header file... * Added priv level maintenance script Added a bash maintenance script that can be run on a scheduled basis that will demote privileged users that have the end times on the accounts that are prior to the date/time the script is executed. * Added donations table Added donations table to db for tracking user donations
21 lines
903 B
SQL
21 lines
903 B
SQL
-- Servatrice db migration from version 19 to version 20
|
|
|
|
alter table cockatrice_users add column privlevelStartDate datetime NOT NULL;
|
|
alter table cockatrice_users add column privlevelEndDate datetime NOT NULL;
|
|
update cockatrice_users set privlevelStartDate = NOW() where privlevel != 'NONE';
|
|
update cockatrice_users set privlevelEndDate = DATE_ADD(NOW() , INTERVAL 30 DAY) where privlevel != 'NONE';
|
|
|
|
CREATE TABLE IF NOT EXISTS `cockatrice_donations` (
|
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
|
`username` varchar(255) DEFAULT NULL,
|
|
`email` varchar(255) DEFAULT NULL,
|
|
`payment_pre_fee` double DEFAULT NULL,
|
|
`payment_post_fee` double DEFAULT NULL,
|
|
`term_length` int(11) DEFAULT NULL,
|
|
`date` varchar(255) DEFAULT NULL,
|
|
`pp_type` varchar(255) DEFAULT NULL,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
UPDATE cockatrice_schema_version SET version=20 WHERE version=19;
|