Commit fadcd735 authored by thejoelinux's avatar thejoelinux

modif contructeurs nom des tables

parent 94c96d59
<?php
header("Location: webroot/", true, 302);
exit();
This diff is collapsed.
alter table subscriptions drop foreign key fk_member_sub_member_id;
alter table subscriptions add CONSTRAINT `fk_member_sub_member_id` FOREIGN KEY (`member_id`) REFERENCES `members` (`id`);
insert into schema_migrations values (201512100649);
CREATE TABLE `reservations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`game_id` int(11) DEFAULT NULL,
`member_id` int(11) DEFAULT NULL,
`reservation_date` date DEFAULT NULL,
`available` int(1) NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO schema_migrations VALUES ('201512180630');
-- for the games
update games set name = replace(name, 'É', 'É');
update games set name = replace(name, 'È', 'È');
update games set name = replace(name, 'À', 'À');
update games set name = replace(name, 'é', 'é');
update games set name = replace(name, 'ÃŽ', 'Î');
update games set name = replace(name, 'Ê', 'Ê');
update games set name = replace(name, 'Ô', 'Ô');
update games set name = replace(name, 'Ä', 'ä');
update games set name = replace(name, 'OÙ', 'Ù');
update games set name = replace(name, 'Ï', 'Ï');
update games set name = replace(name, 'Ö', 'ö');
update members set lastname = replace( lastname, 'É', 'É');
update members set firstname = replace( firstname, 'É', 'É');
update members set firstname = replace( firstname, 'é', 'é');
update members set po_town = replace( po_town, 'è', 'è');
update members set po_town = replace( po_town, 'É', 'É');
update members set other_members = replace( other_members, 'É', 'É');
update members set other_members = replace( other_members, 'È', 'È');
update members set other_members = replace( other_members, 'é', 'é');
update members set other_members = replace( other_members, 'ô', 'ô');
update members set other_members = replace( other_members, 'ç', 'ç');
update members set firstname = replace( firstname, 'ç', 'ç');
update members set address = replace( address, 'ë', 'ë');
update members set address = replace( address, 'é', 'é');
update members set firstname = replace( firstname, 'è', 'ê';
update members set firstname = replace( firstname, 'ë', 'æ');
update members set firstname = replace( firstname, 'ë', 'ë');
update members set address = replace( address, 'ô', 'ô');
update members set address = replace( address, 'ê', 'ê');
update members set address = replace( address, 'É', 'É');
update members set address = replace( address, 'è', 'è');
update members set po_town = replace( po_town, 'â', 'â');
update members set other_members = replace( other_members, 'ë', 'ë');
update members set other_members = replace( other_members, 'Ç', 'Ç');
update members set other_members = replace( other_members, 'è', 'è');
update members set other_members = replace( other_members, 'î', 'î');
update members set other_members = replace( other_members, 'ï', 'ï');
insert into schema_migrations values ('201512271652');
CREATE TABLE IF NOT EXISTS `sessions` (
`session_key` varchar(32) NOT NULL,
`session_data` text,
`session_expires` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `sessions`
ADD PRIMARY KEY (`session_key`);
INSERT INTO schema_migrations VALUES ('201601081120');
ALTER TABLE `bank_operations` ADD KEY `move_id_idx` (`move_id`);
ALTER TABLE `bank_operations` CHANGE `move_id` `move_id` INT(11) NULL DEFAULT NULL;
update bank_operations set move_id = NULL where move_id = 0;
ALTER TABLE `bank_operations` ADD FOREIGN KEY (`move_id`) REFERENCES `ludotheque`.`moves`(`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
INSERT INTO schema_migrations values ('201601301833');
CREATE TABLE IF NOT EXISTS `checkbooks` (
`id` int(11) NOT NULL,
`name` varchar(128) NOT NULL,
`num_start` int(11) NOT NULL,
`num_end` int(11) NOT NULL,
`num_length` int(11) NOT NULL,
`account_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `checkbooks` ADD PRIMARY KEY (`id`);
ALTER TABLE `checkbooks` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT:;
CREATE TABLE IF NOT EXISTS `checks` (
`id` varchar(16) NOT NULL,
`checkbook_id` int(11) NOT NULL,
`move_id` int(11) DEFAULT NULL,
`is_canceled` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `checks`
ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `move_id` (`move_id`), ADD KEY `checkbook_id` (`checkbook_id`);
ALTER TABLE `checks`
ADD CONSTRAINT `checks_ibfk_1` FOREIGN KEY (`checkbook_id`) REFERENCES `checkbooks` (`id`),
ADD CONSTRAINT `checks_ibfk_2` FOREIGN KEY (`move_id`) REFERENCES `moves` (`id`);
INSERT INTO schema_migrations VALUES ('201601310006');
ALTER TABLE `members` ADD `account_id` INT NULL DEFAULT NULL AFTER `other_members`, ADD INDEX (`account_id`) ;
ALTER TABLE `members` ADD FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
INSERT INTO schema_migrations values ('201602031718');
......@@ -14,6 +14,7 @@ class Game extends Record {
public static $table = "lud_games";
public function __construct($id = 0) {
$this->table = "lud_games";
if (!$this->id) {
$this->id = $id;
}
......
......@@ -11,6 +11,7 @@ class Loan extends Record {
public function __construct($id = 0)
{
$this->table = "lud_loans";
if (!$this->id) {
$this->id = $id;
}
......
......@@ -6,6 +6,7 @@ class Membership_Type extends Record {
public static $table = "lud_membership_types";
public function __construct($id = 0) {
$this->table = "lud_membership_types";
if (!$this->id) {
$this->id = $id;
}
......
......@@ -6,6 +6,7 @@ class Payment_Method extends Record {
public static $table = "lud_payment_methods";
public function __construct($id = 0) {
$this->table = "lud_payment_methods";
if (!$this->id) {
$this->id = $id;
}
......
......@@ -10,6 +10,7 @@ class Reservation extends Record {
public function __construct($id = 0)
{
$this->table = "lud_reservations";
if (!$this->id) {
$this->id = $id;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment