SourceForge has been redesigned. Learn more.
Close

[c5a3d1]: / Database / DataBase.sql  Maximize  Restore  History

Download this file

132 lines (108 with data), 4.2 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
-- 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,
`name` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`element` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
`level` tinyint(2) NOT NULL DEFAULT '1',
`atack` int(5) unsigned DEFAULT NULL,
`defence` int(5) unsigned DEFAULT NULL,
`main` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
`card-type` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
`type` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
`script` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Struttura della tabella `deck`
--
CREATE TABLE `deck` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
`owner` int(11) unsigned NOT NULL,
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;
-- --------------------------------------------------------
--
-- Struttura della tabella `duel`
--
CREATE TABLE `duel` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`player1` int(11) unsigned NOT NULL,
`player2` int(11) unsigned NOT NULL,
`life_pl1` int(5) NOT NULL,
`life_pl2` int(5) NOT NULL,
`ip_pl1` varchar(11) COLLATE utf8_unicode_ci NOT NULL,
`ip_pl2` varchar(11) COLLATE utf8_unicode_ci NOT NULL,
`turn` int(3) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Struttura della tabella `users`
--
CREATE TABLE `users` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(11) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
`eqdeck` int(10) unsigned NOT NULL DEFAULT '0',
`level` smallint(3) unsigned NOT NULL DEFAULT '1',
`exp` double unsigned NOT NULL,
`rank` smallint(2) unsigned NOT NULL DEFAULT '0',
`active` tinyint(1) NOT NULL DEFAULT '0',
`lastlog` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) 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 */;