| 1 | -- XTS [http://www.opentheatre.co.uk] |
|---|
| 2 | -- |
|---|
| 3 | -- file: rc4-to-rc5.sql |
|---|
| 4 | -- description: Migration SQL script to upgrade the RC4 database schema to RC5 |
|---|
| 5 | -- creator: Alex Macmillan |
|---|
| 6 | -- created: 2009 |
|---|
| 7 | -- |
|---|
| 8 | -- The contents of this file are subject to the Mozilla Public License |
|---|
| 9 | -- Version 1.1 (the "License"); you may not use this file except in |
|---|
| 10 | -- compliance with the License. You may obtain a copy of the License at |
|---|
| 11 | -- http://www.mozilla.org/MPL/ |
|---|
| 12 | -- |
|---|
| 13 | -- Software distributed under the License is distributed on an "AS IS" |
|---|
| 14 | -- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|---|
| 15 | -- License for the specific language governing rights and limitations |
|---|
| 16 | -- under the License. |
|---|
| 17 | -- |
|---|
| 18 | -- The Original Code is XTS eXtensible Ticketing System, unreleased. |
|---|
| 19 | -- |
|---|
| 20 | -- The Initial Developer of the Original Code is Alexander Macmillan. |
|---|
| 21 | -- Portions created by Alexander Macmillan are Copyright (C) 2009 |
|---|
| 22 | -- Alexander Macmillan. All Rights Reserved. |
|---|
| 23 | -- |
|---|
| 24 | -- Contributor(s): ______________________________________. |
|---|
| 25 | |
|---|
| 26 | -- Create the snewts_paymenttype table |
|---|
| 27 | CREATE TABLE `snewts_paymenttype` ( |
|---|
| 28 | `id` int(11) NOT NULL auto_increment, |
|---|
| 29 | `name` varchar(24) NOT NULL, |
|---|
| 30 | `enabled` tinyint(1) NOT NULL, |
|---|
| 31 | PRIMARY KEY (`id`) |
|---|
| 32 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1; |
|---|
| 33 | |
|---|
| 34 | -- Create the two payment types available by default in RC4 |
|---|
| 35 | INSERT INTO `snewts_paymenttype` (`id`,`name`,`enabled`) VALUES ('1','Cash','1'); |
|---|
| 36 | INSERT INTO `snewts_paymenttype` (`id`,`name`,`enabled`) VALUES ('2','Card','1'); |
|---|
| 37 | |
|---|
| 38 | -- Rename the paymenttype column in the ticket table to paymenttype_id |
|---|
| 39 | ALTER TABLE `snewts_ticket` CHANGE COLUMN `paymenttype` `paymenttype_id` INT; |
|---|
| 40 | |
|---|
| 41 | -- Add a key to the paymenttype_id column |
|---|
| 42 | ALTER TABLE `snewts_ticket` ADD KEY `snewts_ticket_paymenttype_id` (`paymenttype_id`); |
|---|