Diff of /Database/DataBase.sql [569eeb] .. [c5a3d1] Maximize Restore

  Switch to side-by-side view

--- a/Database/DataBase.sql
+++ b/Database/DataBase.sql
@@ -1,3 +1,31 @@
+-- phpMyAdmin SQL Dump
+-- version 3.5.2.2
+-- http://www.phpmyadmin.net
+--
+-- Host: 127.0.0.1
+-- Generato il: Giu 10, 2014 alle 11:11
+-- Versione del server: 5.5.27
+-- Versione PHP: 5.4.7
+
+SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+SET time_zone = "+00:00";
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+
+--
+-- Database: `yugi`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Struttura della tabella `cards`
+--
+
 CREATE TABLE `cards` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
   `code` varchar(11) COLLATE utf8_unicode_ci NOT NULL,
@@ -12,7 +40,7 @@
   `script` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
   PRIMARY KEY (`id`),
   UNIQUE KEY `code` (`code`)
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
 
 -- --------------------------------------------------------
 
@@ -24,11 +52,24 @@
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
   `name` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
   `owner` int(11) unsigned NOT NULL,
-  `cards` text COLLATE utf8_unicode_ci NOT NULL,
-  `side` text COLLATE utf8_unicode_ci NOT NULL,
-  `extra` text COLLATE utf8_unicode_ci NOT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+  PRIMARY KEY (`id`),
+  KEY `owner` (`owner`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+-- --------------------------------------------------------
+
+--
+-- Struttura della tabella `deck_cards`
+--
+
+CREATE TABLE `deck_cards` (
+  `deckid` int(11) unsigned NOT NULL,
+  `location` enum('d','e','s') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'd',
+  `card` varchar(11) COLLATE utf8_unicode_ci NOT NULL,
+  `quantity` tinyint(1) unsigned NOT NULL DEFAULT '1',
+  PRIMARY KEY (`deckid`,`location`,`card`),
+  KEY `card` (`card`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
 
 -- --------------------------------------------------------
 
@@ -46,7 +87,7 @@
   `ip_pl2` varchar(11) COLLATE utf8_unicode_ci NOT NULL,
   `turn` int(3) unsigned NOT NULL,
   PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
 
 -- --------------------------------------------------------
 
@@ -66,4 +107,25 @@
   `active` tinyint(1) NOT NULL DEFAULT '0',
   `lastlog` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
   PRIMARY KEY (`id`)
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+--
+-- Limiti per le tabelle scaricate
+--
+
+--
+-- Limiti per la tabella `deck`
+--
+ALTER TABLE `deck`
+  ADD CONSTRAINT `deck_ibfk_1` FOREIGN KEY (`owner`) REFERENCES `users` (`id`) ON DELETE CASCADE;
+
+--
+-- Limiti per la tabella `deck_cards`
+--
+ALTER TABLE `deck_cards`
+  ADD CONSTRAINT `deck_cards_ibfk_1` FOREIGN KEY (`deckid`) REFERENCES `deck` (`id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `deck_cards_ibfk_2` FOREIGN KEY (`card`) REFERENCES `cards` (`code`) ON DELETE CASCADE ON UPDATE CASCADE;
+
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;