Code re-style.

This commit is contained in:
2020-08-05 21:00:35 +01:00
parent 6f728047c3
commit 569eaa09f6
142 changed files with 5327 additions and 2877 deletions

View File

@@ -62,62 +62,59 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string OwnedConsoles = V9.OwnedConsoles;
public static readonly string Processors =
"CREATE TABLE `processors` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`name` char(50) NOT NULL DEFAULT '',\n" +
"`company` int(11) DEFAULT NULL,\n" +
"`model_code` varchar(45) DEFAULT NULL,\n" +
"`introduced` datetime DEFAULT NULL,\n" +
"`instruction_set` int(11) DEFAULT NULL,\n" +
"`speed` double DEFAULT NULL,\n" +
"`package` varchar(45) DEFAULT NULL,\n" +
"`GPRs` int(11) DEFAULT NULL,\n" +
"`GPR_size` int(11) DEFAULT NULL,\n" +
"`FPRs` int(11) DEFAULT NULL,\n" +
"`FPR_size` int(11) DEFAULT NULL,\n" +
"`cores` int(11) DEFAULT NULL,\n" +
"`threads_per_core` int(11) DEFAULT NULL,\n" +
"`process` varchar(45) DEFAULT NULL,\n" +
"`process_nm` float DEFAULT NULL,\n" +
"`die_size` float DEFAULT NULL,\n" +
"`transistors` bigint(20) DEFAULT NULL,\n" +
"`data_bus` int(11) DEFAULT NULL,\n" +
"`addr_bus` int(11) DEFAULT NULL,\n" +
"`SIMD_registers` int(11) DEFAULT NULL,\n" +
"`SIMD_size` int(11) DEFAULT NULL,\n" +
"`L1_instruction` float DEFAULT NULL,\n" +
"`L1_data` float DEFAULT NULL,\n" +
"`L2` float DEFAULT NULL,\n" +
"`L3` float DEFAULT NULL,\n" +
"PRIMARY KEY (`id`),\n" +
"KEY `idx_processors_name` (`name`),\n" +
"KEY `idx_processors_company` (`company`),\n" +
"KEY `idx_processors_model_code` (`model_code`),\n" +
"KEY `idx_processors_introduced` (`introduced`),\n" +
"KEY `idx_processors_instruction_set` (`instruction_set`),\n" +
"KEY `idx_processors_speed` (`speed`),\n" +
"KEY `idx_processors_package` (`package`),\n" +
"KEY `idx_processors_GPRs` (`GPRs`),\n" +
"KEY `idx_processors_GPR_size` (`GPR_size`),\n" +
"KEY `idx_processors_FPRs` (`FPRs`),\n" +
"KEY `idx_processors_FPR_size` (`FPR_size`),\n" +
"KEY `idx_processors_cores` (`cores`),\n" +
"KEY `idx_processors_threads_per_core` (`threads_per_core`),\n" +
"KEY `idx_processors_process` (`process`),\n" +
"KEY `idx_processors_process_nm` (`process_nm`),\n" +
"KEY `idx_processors_die_size` (`die_size`),\n" +
"KEY `idx_processors_transistors` (`transistors`),\n" +
"KEY `idx_processors_data_bus` (`data_bus`),\n" +
"KEY `idx_processors_addr_bus` (`addr_bus`),\n" +
"KEY `idx_processors_SIMD_registers` (`SIMD_registers`),\n" +
"KEY `idx_processors_SIMD_size` (`SIMD_size`),\n" +
"KEY `idx_processors_L1_instruction` (`L1_instruction`),\n" +
"KEY `idx_processors_L1_data` (`L1_data`),\n" +
"KEY `idx_processors_L2` (`L2`),\n" +
"KEY `idx_processors_L3` (`L3`),\n" +
"CONSTRAINT `fk_processors_company` FOREIGN KEY (`company`) REFERENCES `companies` (`id`) ON UPDATE CASCADE,\n" +
"CONSTRAINT `fk_processors_instruction_set` FOREIGN KEY (`instruction_set`) REFERENCES `instruction_sets` (`id`) ON UPDATE CASCADE);";
public static readonly string Processors = "CREATE TABLE `processors` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`name` char(50) NOT NULL DEFAULT '',\n" +
"`company` int(11) DEFAULT NULL,\n" +
"`model_code` varchar(45) DEFAULT NULL,\n" +
"`introduced` datetime DEFAULT NULL,\n" +
"`instruction_set` int(11) DEFAULT NULL,\n" +
"`speed` double DEFAULT NULL,\n" +
"`package` varchar(45) DEFAULT NULL,\n" +
"`GPRs` int(11) DEFAULT NULL,\n" +
"`GPR_size` int(11) DEFAULT NULL,\n" +
"`FPRs` int(11) DEFAULT NULL,\n" +
"`FPR_size` int(11) DEFAULT NULL,\n" +
"`cores` int(11) DEFAULT NULL,\n" +
"`threads_per_core` int(11) DEFAULT NULL,\n" +
"`process` varchar(45) DEFAULT NULL,\n" +
"`process_nm` float DEFAULT NULL,\n" +
"`die_size` float DEFAULT NULL,\n" +
"`transistors` bigint(20) DEFAULT NULL,\n" +
"`data_bus` int(11) DEFAULT NULL,\n" +
"`addr_bus` int(11) DEFAULT NULL,\n" +
"`SIMD_registers` int(11) DEFAULT NULL,\n" +
"`SIMD_size` int(11) DEFAULT NULL,\n" +
"`L1_instruction` float DEFAULT NULL,\n" +
"`L1_data` float DEFAULT NULL,\n" + "`L2` float DEFAULT NULL,\n" +
"`L3` float DEFAULT NULL,\n" + "PRIMARY KEY (`id`),\n" +
"KEY `idx_processors_name` (`name`),\n" +
"KEY `idx_processors_company` (`company`),\n" +
"KEY `idx_processors_model_code` (`model_code`),\n" +
"KEY `idx_processors_introduced` (`introduced`),\n" +
"KEY `idx_processors_instruction_set` (`instruction_set`),\n" +
"KEY `idx_processors_speed` (`speed`),\n" +
"KEY `idx_processors_package` (`package`),\n" +
"KEY `idx_processors_GPRs` (`GPRs`),\n" +
"KEY `idx_processors_GPR_size` (`GPR_size`),\n" +
"KEY `idx_processors_FPRs` (`FPRs`),\n" +
"KEY `idx_processors_FPR_size` (`FPR_size`),\n" +
"KEY `idx_processors_cores` (`cores`),\n" +
"KEY `idx_processors_threads_per_core` (`threads_per_core`),\n" +
"KEY `idx_processors_process` (`process`),\n" +
"KEY `idx_processors_process_nm` (`process_nm`),\n" +
"KEY `idx_processors_die_size` (`die_size`),\n" +
"KEY `idx_processors_transistors` (`transistors`),\n" +
"KEY `idx_processors_data_bus` (`data_bus`),\n" +
"KEY `idx_processors_addr_bus` (`addr_bus`),\n" +
"KEY `idx_processors_SIMD_registers` (`SIMD_registers`),\n" +
"KEY `idx_processors_SIMD_size` (`SIMD_size`),\n" +
"KEY `idx_processors_L1_instruction` (`L1_instruction`),\n" +
"KEY `idx_processors_L1_data` (`L1_data`),\n" +
"KEY `idx_processors_L2` (`L2`),\n" +
"KEY `idx_processors_L3` (`L3`),\n" +
"CONSTRAINT `fk_processors_company` FOREIGN KEY (`company`) REFERENCES `companies` (`id`) ON UPDATE CASCADE,\n" +
"CONSTRAINT `fk_processors_instruction_set` FOREIGN KEY (`instruction_set`) REFERENCES `instruction_sets` (`id`) ON UPDATE CASCADE);";
public static readonly string SoundSynths = V9.SoundSynths;
@@ -146,18 +143,13 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string InstructionSetExtensionsByProcessor =
"CREATE TABLE IF NOT EXISTS `instruction_set_extensions_by_processor` (\n" +
"`id` INT NOT NULL AUTO_INCREMENT,\n" +
"`processor_id` INT NOT NULL,\n" +
"`extension_id` INT NOT NULL,\n" +
"PRIMARY KEY (`id`, `processor_id`, `extension_id`),\n" +
"INDEX `idx_setextension_processor` (`processor_id` ASC),\n" +
"INDEX `idx_setextension_extension` (`extension_id` ASC),\n" +
"CONSTRAINT `fk_extension_processor_id`\n" +
"FOREIGN KEY (`processor_id`)\n" +
"REFERENCES `processors` (`id`)\n" + "ON DELETE RESTRICT\n" +
"ON UPDATE CASCADE,\n" +
"CONSTRAINT `fk_extension_extension_id`\n" + "FOREIGN KEY (`extension_id`)\n" +
"REFERENCES `instruction_set_extensions` (`id`)\n" +
"ON DELETE RESTRICT\n" + "ON UPDATE CASCADE);";
"`id` INT NOT NULL AUTO_INCREMENT,\n" + "`processor_id` INT NOT NULL,\n" +
"`extension_id` INT NOT NULL,\n" +
"PRIMARY KEY (`id`, `processor_id`, `extension_id`),\n" +
"INDEX `idx_setextension_processor` (`processor_id` ASC),\n" +
"INDEX `idx_setextension_extension` (`extension_id` ASC),\n" + "CONSTRAINT `fk_extension_processor_id`\n" +
"FOREIGN KEY (`processor_id`)\n" + "REFERENCES `processors` (`id`)\n" + "ON DELETE RESTRICT\n" +
"ON UPDATE CASCADE,\n" + "CONSTRAINT `fk_extension_extension_id`\n" + "FOREIGN KEY (`extension_id`)\n" +
"REFERENCES `instruction_set_extensions` (`id`)\n" + "ON DELETE RESTRICT\n" + "ON UPDATE CASCADE);";
}
}

View File

@@ -48,25 +48,24 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string Forbidden = V10.Forbidden;
public static readonly string Gpus = "CREATE TABLE `gpus` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`name` char(128) NOT NULL DEFAULT '',\n" +
"`company` int(11) DEFAULT NULL,\n" +
"`model_code` varchar(45) DEFAULT NULL,\n" +
"`introduced` datetime DEFAULT NULL,\n" +
"`package` varchar(45) DEFAULT NULL,\n" +
"`process` varchar(45) DEFAULT NULL,\n" +
"`process_nm` float DEFAULT NULL,\n" +
"`die_size` float DEFAULT NULL,\n" +
"`transistors` bigint(20) DEFAULT NULL,\n" + "PRIMARY KEY (`id`),\n" +
"KEY `idx_gpus_name` (`name`),\n" +
"KEY `idx_gpus_company` (`company`),\n" +
"KEY `idx_gpus_model_code` (`model_code`),\n" +
"KEY `idx_gpus_introduced` (`introduced`),\n" +
"KEY `idx_gpus_package` (`package`),\n" +
"KEY `idx_gpus_process` (`process`),\n" +
"KEY `idx_gpus_process_nm` (`process_nm`),\n" +
"KEY `idx_gpus_die_size` (`die_size`),\n" +
public static readonly string Gpus = "CREATE TABLE `gpus` (\n" + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`name` char(128) NOT NULL DEFAULT '',\n" +
"`company` int(11) DEFAULT NULL,\n" +
"`model_code` varchar(45) DEFAULT NULL,\n" +
"`introduced` datetime DEFAULT NULL,\n" +
"`package` varchar(45) DEFAULT NULL,\n" +
"`process` varchar(45) DEFAULT NULL,\n" +
"`process_nm` float DEFAULT NULL,\n" +
"`die_size` float DEFAULT NULL,\n" +
"`transistors` bigint(20) DEFAULT NULL,\n" + "PRIMARY KEY (`id`),\n" +
"KEY `idx_gpus_name` (`name`),\n" +
"KEY `idx_gpus_company` (`company`),\n" +
"KEY `idx_gpus_model_code` (`model_code`),\n" +
"KEY `idx_gpus_introduced` (`introduced`),\n" +
"KEY `idx_gpus_package` (`package`),\n" +
"KEY `idx_gpus_process` (`process`),\n" +
"KEY `idx_gpus_process_nm` (`process_nm`),\n" +
"KEY `idx_gpus_die_size` (`die_size`),\n" +
"KEY `idx_gpus_transistors` (`transistors`),\n" +
"CONSTRAINT `fk_gpus_company` FOREIGN KEY (`company`) REFERENCES `companies` (`id`) ON UPDATE CASCADE);";

View File

@@ -40,110 +40,104 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string Companies = V11.Companies;
public static readonly string Computers = "CREATE TABLE `computers` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`company` int(11) NOT NULL DEFAULT '0',\n" +
"`year` int(11) NOT NULL DEFAULT '0',\n" +
"`model` char(50) NOT NULL DEFAULT '',\n" +
"`cpu1` int(11) DEFAULT NULL,\n" +
"`mhz1` int(11) DEFAULT NULL,\n" +
"`cpu2` int(11) DEFAULT NULL,\n" +
"`mhz2` decimal(11,2) DEFAULT NULL,\n" +
"`bits` int(11) NOT NULL DEFAULT '0',\n" +
"`ram` int(11) NOT NULL DEFAULT '0',\n" +
"`rom` int(11) NOT NULL DEFAULT '0',\n" +
"`gpu` int(11) DEFAULT NULL,\n" +
"`vram` int(11) NOT NULL DEFAULT '0',\n" +
"`colors` int(11) NOT NULL DEFAULT '0',\n" +
"`res` char(10) NOT NULL DEFAULT '',\n" +
"`sound_synth` int(11) NOT NULL DEFAULT '0',\n" +
"`music_synth` int(11) NOT NULL DEFAULT '0',\n" +
"`sound_channels` int(11) NOT NULL DEFAULT '0',\n" +
"`music_channels` int(11) NOT NULL DEFAULT '0',\n" +
"`hdd1` int(11) NOT NULL DEFAULT '0',\n" +
"`hdd2` int(11) DEFAULT NULL,\n" +
"`hdd3` int(11) DEFAULT NULL,\n" +
"`disk1` int(11) NOT NULL DEFAULT '0',\n" +
"`cap1` char(25) NOT NULL DEFAULT '0',\n" +
"`disk2` int(11) DEFAULT NULL,\n" +
"`cap2` char(25) DEFAULT NULL,\n" +
"PRIMARY KEY (`id`),\n" +
"KEY `idx_computers_company` (`company`),\n" +
"KEY `idx_computers_year` (`year`),\n" +
"KEY `idx_computers_model` (`model`),\n" +
"KEY `idx_computers_cpu1` (`cpu1`),\n" +
"KEY `idx_computers_cpu2` (`cpu2`),\n" +
"KEY `idx_computers_mhz1` (`mhz1`),\n" +
"KEY `idx_computers_mhz2` (`mhz2`),\n" +
"KEY `idx_computers_bits` (`bits`),\n" +
"KEY `idx_computers_ram` (`ram`),\n" +
"KEY `idx_computers_rom` (`rom`),\n" +
"KEY `idx_computers_gpu` (`gpu`),\n" +
"KEY `idx_computers_vram` (`vram`),\n" +
"KEY `idx_computers_colors` (`colors`),\n" +
"KEY `idx_computers_res` (`res`),\n" +
public static readonly string Computers = "CREATE TABLE `computers` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`company` int(11) NOT NULL DEFAULT '0',\n" +
"`year` int(11) NOT NULL DEFAULT '0',\n" +
"`model` char(50) NOT NULL DEFAULT '',\n" +
"`cpu1` int(11) DEFAULT NULL,\n" + "`mhz1` int(11) DEFAULT NULL,\n" +
"`cpu2` int(11) DEFAULT NULL,\n" +
"`mhz2` decimal(11,2) DEFAULT NULL,\n" +
"`bits` int(11) NOT NULL DEFAULT '0',\n" +
"`ram` int(11) NOT NULL DEFAULT '0',\n" +
"`rom` int(11) NOT NULL DEFAULT '0',\n" +
"`gpu` int(11) DEFAULT NULL,\n" +
"`vram` int(11) NOT NULL DEFAULT '0',\n" +
"`colors` int(11) NOT NULL DEFAULT '0',\n" +
"`res` char(10) NOT NULL DEFAULT '',\n" +
"`sound_synth` int(11) NOT NULL DEFAULT '0',\n" +
"`music_synth` int(11) NOT NULL DEFAULT '0',\n" +
"`sound_channels` int(11) NOT NULL DEFAULT '0',\n" +
"`music_channels` int(11) NOT NULL DEFAULT '0',\n" +
"`hdd1` int(11) NOT NULL DEFAULT '0',\n" +
"`hdd2` int(11) DEFAULT NULL,\n" + "`hdd3` int(11) DEFAULT NULL,\n" +
"`disk1` int(11) NOT NULL DEFAULT '0',\n" +
"`cap1` char(25) NOT NULL DEFAULT '0',\n" +
"`disk2` int(11) DEFAULT NULL,\n" +
"`cap2` char(25) DEFAULT NULL,\n" + "PRIMARY KEY (`id`),\n" +
"KEY `idx_computers_company` (`company`),\n" +
"KEY `idx_computers_year` (`year`),\n" +
"KEY `idx_computers_model` (`model`),\n" +
"KEY `idx_computers_cpu1` (`cpu1`),\n" +
"KEY `idx_computers_cpu2` (`cpu2`),\n" +
"KEY `idx_computers_mhz1` (`mhz1`),\n" +
"KEY `idx_computers_mhz2` (`mhz2`),\n" +
"KEY `idx_computers_bits` (`bits`),\n" +
"KEY `idx_computers_ram` (`ram`),\n" +
"KEY `idx_computers_rom` (`rom`),\n" +
"KEY `idx_computers_gpu` (`gpu`),\n" +
"KEY `idx_computers_vram` (`vram`),\n" +
"KEY `idx_computers_colors` (`colors`),\n" +
"KEY `idx_computers_res` (`res`),\n" +
"KEY `idx_computers_sound_synth` (`sound_synth`),\n" +
"KEY `idx_computers_music_synth` (`music_synth`),\n" +
"KEY `idx_computers_hdd1` (`hdd1`),\n" +
"KEY `idx_computers_hdd2` (`hdd2`),\n" +
"KEY `idx_computers_hdd3` (`hdd3`),\n" +
"KEY `idx_computers_disk1` (`disk1`),\n" +
"KEY `idx_computers_disk2` (`disk2`),\n" +
"KEY `idx_computers_cap1` (`cap1`),\n" +
"KEY `idx_computers_hdd1` (`hdd1`),\n" +
"KEY `idx_computers_hdd2` (`hdd2`),\n" +
"KEY `idx_computers_hdd3` (`hdd3`),\n" +
"KEY `idx_computers_disk1` (`disk1`),\n" +
"KEY `idx_computers_disk2` (`disk2`),\n" +
"KEY `idx_computers_cap1` (`cap1`),\n" +
"KEY `idx_computers_cap2` (`cap2`))";
public static readonly string Consoles = "CREATE TABLE `consoles` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`company` int(11) NOT NULL DEFAULT '0',\n" +
"`model` char(50) NOT NULL DEFAULT '',\n" +
"`year` int(11) NOT NULL DEFAULT '0',\n" +
"`cpu1` int(11) DEFAULT NULL,\n" +
"`mhz1` int(11) DEFAULT NULL,\n" +
"`cpu2` int(11) DEFAULT NULL,\n" +
"`mhz2` decimal(11,2) DEFAULT NULL,\n" +
"`bits` int(11) NOT NULL DEFAULT '0',\n" +
"`ram` int(11) NOT NULL DEFAULT '0',\n" +
"`rom` int(11) NOT NULL DEFAULT '0',\n" +
"`gpu` int(11) DEFAULT NULL,\n" +
"`vram` int(11) NOT NULL DEFAULT '0',\n" +
"`res` char(11) NOT NULL DEFAULT '',\n" +
"`colors` int(11) NOT NULL DEFAULT '0',\n" +
"`palette` int(11) NOT NULL DEFAULT '0',\n" +
"`sound_synth` int(11) NOT NULL DEFAULT '0',\n" +
"`schannels` int(11) NOT NULL DEFAULT '0',\n" +
"`music_synth` int(11) NOT NULL DEFAULT '0',\n" +
"`mchannels` int(11) NOT NULL DEFAULT '0',\n" +
"`format` int(11) NOT NULL DEFAULT '0',\n" +
"`cap` int(11) NOT NULL DEFAULT '0',\n" +
"PRIMARY KEY (`id`),\n" +
"KEY `idx_consoles_company` (`company`),\n" +
"KEY `idx_consoles_year` (`year`),\n" +
"KEY `idx_consoles_model` (`model`),\n" +
"KEY `idx_consoles_cpu1` (`cpu1`),\n" +
"KEY `idx_consoles_cpu2` (`cpu2`),\n" +
"KEY `idx_consoles_mhz1` (`mhz1`),\n" +
"KEY `idx_consoles_mhz2` (`mhz2`),\n" +
"KEY `idx_consoles_bits` (`bits`),\n" +
"KEY `idx_consoles_ram` (`ram`),\n" +
"KEY `idx_consoles_rom` (`rom`),\n" +
"KEY `idx_consoles_gpu` (`gpu`),\n" +
"KEY `idx_consoles_vram` (`vram`),\n" +
"KEY `idx_consoles_colors` (`colors`),\n" +
"KEY `idx_consoles_res` (`res`),\n" +
public static readonly string Consoles = "CREATE TABLE `consoles` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`company` int(11) NOT NULL DEFAULT '0',\n" +
"`model` char(50) NOT NULL DEFAULT '',\n" +
"`year` int(11) NOT NULL DEFAULT '0',\n" +
"`cpu1` int(11) DEFAULT NULL,\n" + "`mhz1` int(11) DEFAULT NULL,\n" +
"`cpu2` int(11) DEFAULT NULL,\n" +
"`mhz2` decimal(11,2) DEFAULT NULL,\n" +
"`bits` int(11) NOT NULL DEFAULT '0',\n" +
"`ram` int(11) NOT NULL DEFAULT '0',\n" +
"`rom` int(11) NOT NULL DEFAULT '0',\n" +
"`gpu` int(11) DEFAULT NULL,\n" +
"`vram` int(11) NOT NULL DEFAULT '0',\n" +
"`res` char(11) NOT NULL DEFAULT '',\n" +
"`colors` int(11) NOT NULL DEFAULT '0',\n" +
"`palette` int(11) NOT NULL DEFAULT '0',\n" +
"`sound_synth` int(11) NOT NULL DEFAULT '0',\n" +
"`schannels` int(11) NOT NULL DEFAULT '0',\n" +
"`music_synth` int(11) NOT NULL DEFAULT '0',\n" +
"`mchannels` int(11) NOT NULL DEFAULT '0',\n" +
"`format` int(11) NOT NULL DEFAULT '0',\n" +
"`cap` int(11) NOT NULL DEFAULT '0',\n" + "PRIMARY KEY (`id`),\n" +
"KEY `idx_consoles_company` (`company`),\n" +
"KEY `idx_consoles_year` (`year`),\n" +
"KEY `idx_consoles_model` (`model`),\n" +
"KEY `idx_consoles_cpu1` (`cpu1`),\n" +
"KEY `idx_consoles_cpu2` (`cpu2`),\n" +
"KEY `idx_consoles_mhz1` (`mhz1`),\n" +
"KEY `idx_consoles_mhz2` (`mhz2`),\n" +
"KEY `idx_consoles_bits` (`bits`),\n" +
"KEY `idx_consoles_ram` (`ram`),\n" +
"KEY `idx_consoles_rom` (`rom`),\n" +
"KEY `idx_consoles_gpu` (`gpu`),\n" +
"KEY `idx_consoles_vram` (`vram`),\n" +
"KEY `idx_consoles_colors` (`colors`),\n" +
"KEY `idx_consoles_res` (`res`),\n" +
"KEY `idx_consoles_sound_synth` (`sound_synth`),\n" +
"KEY `idx_consoles_music_synth` (`music_synth`),\n" +
"KEY `idx_consoles_palette` (`palette`),\n" +
"KEY `idx_consoles_format` (`format`),\n" +
"KEY `idx_consoles_palette` (`palette`),\n" +
"KEY `idx_consoles_format` (`format`),\n" +
"KEY `idx_consoles_cap` (`cap`));";
public static readonly string DiskFormats = V11.DiskFormats;
public static readonly string Forbidden = V11.Forbidden;
public static readonly string Gpus =
V11.Gpus + "\n" +
$"INSERT INTO `gpus` (`id`, `name`) VALUES ({Operations.DB_NONE}, `DB_NONE`);\n" +
$"INSERT INTO `gpus` (`id`, `name`) VALUES ({Operations.DB_SOFTWARE}, `DB_FRAMEBUFFER`);";
public static readonly string Gpus = V11.Gpus + "\n" +
$"INSERT INTO `gpus` (`id`, `name`) VALUES ({Operations.DB_NONE}, `DB_NONE`);\n" +
$"INSERT INTO `gpus` (`id`, `name`) VALUES ({Operations.DB_SOFTWARE}, `DB_FRAMEBUFFER`);";
public static readonly string Logs = V11.Logs;

View File

@@ -40,100 +40,95 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string Companies = V12.Companies;
public static readonly string Computers = "CREATE TABLE `computers` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`company` int(11) NOT NULL DEFAULT '0',\n" +
"`year` int(11) NOT NULL DEFAULT '0',\n" +
"`model` char(50) NOT NULL DEFAULT '',\n" +
"`cpu1` int(11) DEFAULT NULL,\n" +
"`mhz1` int(11) DEFAULT NULL,\n" +
"`cpu2` int(11) DEFAULT NULL,\n" +
"`mhz2` decimal(11,2) DEFAULT NULL,\n" +
"`bits` int(11) NOT NULL DEFAULT '0',\n" +
"`ram` int(11) NOT NULL DEFAULT '0',\n" +
"`rom` int(11) NOT NULL DEFAULT '0',\n" +
"`gpu` int(11) DEFAULT NULL,\n" +
"`vram` int(11) NOT NULL DEFAULT '0',\n" +
"`colors` int(11) NOT NULL DEFAULT '0',\n" +
"`res` char(10) NOT NULL DEFAULT '',\n" +
"`sound_synth` int(11) NOT NULL DEFAULT '0',\n" +
"`music_synth` int(11) NOT NULL DEFAULT '0',\n" +
"`sound_channels` int(11) NOT NULL DEFAULT '0',\n" +
"`music_channels` int(11) NOT NULL DEFAULT '0',\n" +
"`hdd1` int(11) NOT NULL DEFAULT '0',\n" +
"`hdd2` int(11) DEFAULT NULL,\n" +
"`hdd3` int(11) DEFAULT NULL,\n" +
"`disk1` int(11) NOT NULL DEFAULT '0',\n" +
"`cap1` char(25) NOT NULL DEFAULT '0',\n" +
"`disk2` int(11) DEFAULT NULL,\n" +
"`cap2` char(25) DEFAULT NULL,\n" +
"PRIMARY KEY (`id`),\n" +
"KEY `idx_computers_company` (`company`),\n" +
"KEY `idx_computers_year` (`year`),\n" +
"KEY `idx_computers_model` (`model`),\n" +
"KEY `idx_computers_cpu1` (`cpu1`),\n" +
"KEY `idx_computers_cpu2` (`cpu2`),\n" +
"KEY `idx_computers_mhz1` (`mhz1`),\n" +
"KEY `idx_computers_mhz2` (`mhz2`),\n" +
"KEY `idx_computers_bits` (`bits`),\n" +
"KEY `idx_computers_ram` (`ram`),\n" +
"KEY `idx_computers_rom` (`rom`),\n" +
"KEY `idx_computers_gpu` (`gpu`),\n" +
"KEY `idx_computers_vram` (`vram`),\n" +
"KEY `idx_computers_colors` (`colors`),\n" +
"KEY `idx_computers_res` (`res`),\n" +
public static readonly string Computers = "CREATE TABLE `computers` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`company` int(11) NOT NULL DEFAULT '0',\n" +
"`year` int(11) NOT NULL DEFAULT '0',\n" +
"`model` char(50) NOT NULL DEFAULT '',\n" +
"`cpu1` int(11) DEFAULT NULL,\n" + "`mhz1` int(11) DEFAULT NULL,\n" +
"`cpu2` int(11) DEFAULT NULL,\n" +
"`mhz2` decimal(11,2) DEFAULT NULL,\n" +
"`bits` int(11) NOT NULL DEFAULT '0',\n" +
"`ram` int(11) NOT NULL DEFAULT '0',\n" +
"`rom` int(11) NOT NULL DEFAULT '0',\n" +
"`gpu` int(11) DEFAULT NULL,\n" +
"`vram` int(11) NOT NULL DEFAULT '0',\n" +
"`colors` int(11) NOT NULL DEFAULT '0',\n" +
"`res` char(10) NOT NULL DEFAULT '',\n" +
"`sound_synth` int(11) NOT NULL DEFAULT '0',\n" +
"`music_synth` int(11) NOT NULL DEFAULT '0',\n" +
"`sound_channels` int(11) NOT NULL DEFAULT '0',\n" +
"`music_channels` int(11) NOT NULL DEFAULT '0',\n" +
"`hdd1` int(11) NOT NULL DEFAULT '0',\n" +
"`hdd2` int(11) DEFAULT NULL,\n" + "`hdd3` int(11) DEFAULT NULL,\n" +
"`disk1` int(11) NOT NULL DEFAULT '0',\n" +
"`cap1` char(25) NOT NULL DEFAULT '0',\n" +
"`disk2` int(11) DEFAULT NULL,\n" +
"`cap2` char(25) DEFAULT NULL,\n" + "PRIMARY KEY (`id`),\n" +
"KEY `idx_computers_company` (`company`),\n" +
"KEY `idx_computers_year` (`year`),\n" +
"KEY `idx_computers_model` (`model`),\n" +
"KEY `idx_computers_cpu1` (`cpu1`),\n" +
"KEY `idx_computers_cpu2` (`cpu2`),\n" +
"KEY `idx_computers_mhz1` (`mhz1`),\n" +
"KEY `idx_computers_mhz2` (`mhz2`),\n" +
"KEY `idx_computers_bits` (`bits`),\n" +
"KEY `idx_computers_ram` (`ram`),\n" +
"KEY `idx_computers_rom` (`rom`),\n" +
"KEY `idx_computers_gpu` (`gpu`),\n" +
"KEY `idx_computers_vram` (`vram`),\n" +
"KEY `idx_computers_colors` (`colors`),\n" +
"KEY `idx_computers_res` (`res`),\n" +
"KEY `idx_computers_sound_synth` (`sound_synth`),\n" +
"KEY `idx_computers_music_synth` (`music_synth`),\n" +
"KEY `idx_computers_hdd1` (`hdd1`),\n" +
"KEY `idx_computers_hdd2` (`hdd2`),\n" +
"KEY `idx_computers_hdd3` (`hdd3`),\n" +
"KEY `idx_computers_disk1` (`disk1`),\n" +
"KEY `idx_computers_disk2` (`disk2`),\n" +
"KEY `idx_computers_cap1` (`cap1`),\n" +
"KEY `idx_computers_hdd1` (`hdd1`),\n" +
"KEY `idx_computers_hdd2` (`hdd2`),\n" +
"KEY `idx_computers_hdd3` (`hdd3`),\n" +
"KEY `idx_computers_disk1` (`disk1`),\n" +
"KEY `idx_computers_disk2` (`disk2`),\n" +
"KEY `idx_computers_cap1` (`cap1`),\n" +
"KEY `idx_computers_cap2` (`cap2`));";
public static readonly string Consoles = "CREATE TABLE `consoles` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`company` int(11) NOT NULL DEFAULT '0',\n" +
"`model` char(50) NOT NULL DEFAULT '',\n" +
"`year` int(11) NOT NULL DEFAULT '0',\n" +
"`cpu1` int(11) DEFAULT NULL,\n" +
"`mhz1` int(11) DEFAULT NULL,\n" +
"`cpu2` int(11) DEFAULT NULL,\n" +
"`mhz2` decimal(11,2) DEFAULT NULL,\n" +
"`bits` int(11) NOT NULL DEFAULT '0',\n" +
"`ram` int(11) NOT NULL DEFAULT '0',\n" +
"`rom` int(11) NOT NULL DEFAULT '0',\n" +
"`gpu` int(11) DEFAULT NULL,\n" +
"`vram` int(11) NOT NULL DEFAULT '0',\n" +
"`res` char(11) NOT NULL DEFAULT '',\n" +
"`colors` int(11) NOT NULL DEFAULT '0',\n" +
"`palette` int(11) NOT NULL DEFAULT '0',\n" +
"`sound_synth` int(11) NOT NULL DEFAULT '0',\n" +
"`schannels` int(11) NOT NULL DEFAULT '0',\n" +
"`music_synth` int(11) NOT NULL DEFAULT '0',\n" +
"`mchannels` int(11) NOT NULL DEFAULT '0',\n" +
"`format` int(11) NOT NULL DEFAULT '0',\n" +
"`cap` int(11) NOT NULL DEFAULT '0',\n" +
"PRIMARY KEY (`id`),\n" +
"KEY `idx_consoles_company` (`company`),\n" +
"KEY `idx_consoles_year` (`year`),\n" +
"KEY `idx_consoles_model` (`model`),\n" +
"KEY `idx_consoles_cpu1` (`cpu1`),\n" +
"KEY `idx_consoles_cpu2` (`cpu2`),\n" +
"KEY `idx_consoles_mhz1` (`mhz1`),\n" +
"KEY `idx_consoles_mhz2` (`mhz2`),\n" +
"KEY `idx_consoles_bits` (`bits`),\n" +
"KEY `idx_consoles_ram` (`ram`),\n" +
"KEY `idx_consoles_rom` (`rom`),\n" +
"KEY `idx_consoles_gpu` (`gpu`),\n" +
"KEY `idx_consoles_vram` (`vram`),\n" +
"KEY `idx_consoles_colors` (`colors`),\n" +
"KEY `idx_consoles_res` (`res`),\n" +
public static readonly string Consoles = "CREATE TABLE `consoles` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`company` int(11) NOT NULL DEFAULT '0',\n" +
"`model` char(50) NOT NULL DEFAULT '',\n" +
"`year` int(11) NOT NULL DEFAULT '0',\n" +
"`cpu1` int(11) DEFAULT NULL,\n" + "`mhz1` int(11) DEFAULT NULL,\n" +
"`cpu2` int(11) DEFAULT NULL,\n" +
"`mhz2` decimal(11,2) DEFAULT NULL,\n" +
"`bits` int(11) NOT NULL DEFAULT '0',\n" +
"`ram` int(11) NOT NULL DEFAULT '0',\n" +
"`rom` int(11) NOT NULL DEFAULT '0',\n" +
"`gpu` int(11) DEFAULT NULL,\n" +
"`vram` int(11) NOT NULL DEFAULT '0',\n" +
"`res` char(11) NOT NULL DEFAULT '',\n" +
"`colors` int(11) NOT NULL DEFAULT '0',\n" +
"`palette` int(11) NOT NULL DEFAULT '0',\n" +
"`sound_synth` int(11) NOT NULL DEFAULT '0',\n" +
"`schannels` int(11) NOT NULL DEFAULT '0',\n" +
"`music_synth` int(11) NOT NULL DEFAULT '0',\n" +
"`mchannels` int(11) NOT NULL DEFAULT '0',\n" +
"`format` int(11) NOT NULL DEFAULT '0',\n" +
"`cap` int(11) NOT NULL DEFAULT '0',\n" + "PRIMARY KEY (`id`),\n" +
"KEY `idx_consoles_company` (`company`),\n" +
"KEY `idx_consoles_year` (`year`),\n" +
"KEY `idx_consoles_model` (`model`),\n" +
"KEY `idx_consoles_cpu1` (`cpu1`),\n" +
"KEY `idx_consoles_cpu2` (`cpu2`),\n" +
"KEY `idx_consoles_mhz1` (`mhz1`),\n" +
"KEY `idx_consoles_mhz2` (`mhz2`),\n" +
"KEY `idx_consoles_bits` (`bits`),\n" +
"KEY `idx_consoles_ram` (`ram`),\n" +
"KEY `idx_consoles_rom` (`rom`),\n" +
"KEY `idx_consoles_gpu` (`gpu`),\n" +
"KEY `idx_consoles_vram` (`vram`),\n" +
"KEY `idx_consoles_colors` (`colors`),\n" +
"KEY `idx_consoles_res` (`res`),\n" +
"KEY `idx_consoles_sound_synth` (`sound_synth`),\n" +
"KEY `idx_consoles_music_synth` (`music_synth`),\n" +
"KEY `idx_consoles_palette` (`palette`),\n" +
"KEY `idx_consoles_format` (`format`),\n" +
"KEY `idx_consoles_palette` (`palette`),\n" +
"KEY `idx_consoles_format` (`format`),\n" +
"KEY `idx_consoles_cap` (`cap`));";
public static readonly string DiskFormats = V12.DiskFormats;
@@ -154,50 +149,49 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string Processors = V12.Processors;
public static readonly string SoundSynths = "CREATE TABLE `sound_synths` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`name` char(50) NOT NULL DEFAULT '',\n" +
"`company` int(11) DEFAULT NULL,\n" +
"`model_code` varchar(45) DEFAULT NULL,\n" +
"`introduced` datetime DEFAULT NULL,\n" +
"`voices` int(11) DEFAULT NULL,\n" +
"`frequency` double DEFAULT NULL,\n" +
"`depth` int(11) DEFAULT NULL,\n" +
"`square_wave` int(11) DEFAULT NULL,\n" +
"`white_noise` int(11) DEFAULT NULL,\n" +
"`type` int(11) DEFAULT NULL,\n" +
"PRIMARY KEY (`id`),\n" +
"KEY `idx_sound_synths_name` (`name`),\n" +
"KEY `idx_sound_synths_company` (`company`),\n" +
"KEY `idx_sound_synths_model_code` (`model_code`),\n" +
"KEY `idx_sound_synths_introduced` (`introduced`),\n" +
"KEY `idx_sound_synths_voices` (`voices`),\n" +
"KEY `idx_sound_synths_frequency` (`frequency`),\n" +
"KEY `idx_sound_synths_depth` (`depth`),\n" +
public static readonly string SoundSynths = "CREATE TABLE `sound_synths` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`name` char(50) NOT NULL DEFAULT '',\n" +
"`company` int(11) DEFAULT NULL,\n" +
"`model_code` varchar(45) DEFAULT NULL,\n" +
"`introduced` datetime DEFAULT NULL,\n" +
"`voices` int(11) DEFAULT NULL,\n" +
"`frequency` double DEFAULT NULL,\n" +
"`depth` int(11) DEFAULT NULL,\n" +
"`square_wave` int(11) DEFAULT NULL,\n" +
"`white_noise` int(11) DEFAULT NULL,\n" +
"`type` int(11) DEFAULT NULL,\n" + "PRIMARY KEY (`id`),\n" +
"KEY `idx_sound_synths_name` (`name`),\n" +
"KEY `idx_sound_synths_company` (`company`),\n" +
"KEY `idx_sound_synths_model_code` (`model_code`),\n" +
"KEY `idx_sound_synths_introduced` (`introduced`),\n" +
"KEY `idx_sound_synths_voices` (`voices`),\n" +
"KEY `idx_sound_synths_frequency` (`frequency`),\n" +
"KEY `idx_sound_synths_depth` (`depth`),\n" +
"KEY `idx_sound_synths_square_wave` (`square_wave`),\n" +
"KEY `idx_sound_synths_white_noise` (`white_noise`),\n" +
"KEY `idx_sound_synths_type` (`type`),\n" +
"KEY `idx_sound_synths_type` (`type`),\n" +
"CONSTRAINT `fk_sound_synths_company` FOREIGN KEY (`company`) REFERENCES `companies` (`id`) ON UPDATE CASCADE);";
public static readonly string ComputersForeignKeys =
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_company (company) REFERENCES companies (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_cpu1 (cpu1) REFERENCES processors (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_cpu2 (cpu2) REFERENCES processors (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_gpu (gpu) REFERENCES gpus (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_sound_synth (sound_synth) REFERENCES sound_synths (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_company (company) REFERENCES companies (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_cpu1 (cpu1) REFERENCES processors (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_cpu2 (cpu2) REFERENCES processors (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_gpu (gpu) REFERENCES gpus (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_sound_synth (sound_synth) REFERENCES sound_synths (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_music_synth (music_synth) REFERENCES sound_synths (id) ON UPDATE CASCADE;\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_hdd1 (hdd1) REFERENCES disk_formats (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_hdd2 (hdd2) REFERENCES disk_formats (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_hdd3 (hdd3) REFERENCES disk_formats (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_disk1 (disk1) REFERENCES disk_formats (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_hdd1 (hdd1) REFERENCES disk_formats (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_hdd2 (hdd2) REFERENCES disk_formats (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_hdd3 (hdd3) REFERENCES disk_formats (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_disk1 (disk1) REFERENCES disk_formats (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_disk2 (disk2) REFERENCES disk_formats (id);";
public static readonly string ConsolesForeignKeys =
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_company (company) REFERENCES companies (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_cpu1 (cpu1) REFERENCES processors (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_cpu2 (cpu2) REFERENCES processors (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_gpu (gpu) REFERENCES gpus (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_sound_synth (sound_synth) REFERENCES sound_synths (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_company (company) REFERENCES companies (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_cpu1 (cpu1) REFERENCES processors (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_cpu2 (cpu2) REFERENCES processors (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_gpu (gpu) REFERENCES gpus (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_sound_synth (sound_synth) REFERENCES sound_synths (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_music_synth (music_synth) REFERENCES sound_synths (id) ON UPDATE CASCADE;\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_format (format) REFERENCES disk_formats (id);";

View File

@@ -40,56 +40,53 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string Companies = V13.Companies;
public static readonly string Machines = "CREATE TABLE `machines` (;\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,;\n" +
"`company` int(11) NOT NULL DEFAULT '0',;\n" +
"`year` int(11) NOT NULL DEFAULT '0',;\n" +
"`model` char(50) NOT NULL DEFAULT '',;\n" +
"`cpu1` int(11) DEFAULT NULL,;\n" +
"`mhz1` int(11) DEFAULT NULL,;\n" +
"`cpu2` int(11) DEFAULT NULL,;\n" +
"`mhz2` decimal(11,2) DEFAULT NULL,;\n" +
"`ram` int(11) NOT NULL DEFAULT '0',;\n" +
"`rom` int(11) NOT NULL DEFAULT '0',;\n" +
"`gpu` int(11) DEFAULT NULL,;\n" +
"`vram` int(11) NOT NULL DEFAULT '0',;\n" +
"`colors` int(11) NOT NULL DEFAULT '0',;\n" +
"`res` char(10) NOT NULL DEFAULT '',;\n" +
"`sound_synth` int(11) NOT NULL DEFAULT '0',;\n" +
"`music_synth` int(11) NOT NULL DEFAULT '0',;\n" +
"`sound_channels` int(11) NOT NULL DEFAULT '0',;\n" +
"`music_channels` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd1` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd2` int(11) DEFAULT NULL,;\n" +
"`hdd3` int(11) DEFAULT NULL,;\n" +
"`disk1` int(11) NOT NULL DEFAULT '0',;\n" +
"`cap1` char(25) NOT NULL DEFAULT '0',;\n" +
"`disk2` int(11) DEFAULT NULL,;\n" +
"`cap2` char(25) DEFAULT NULL,;\n" +
"`type` int(11) NOT NULL DEFAULT '0',;\n" +
"PRIMARY KEY (`id`),;\n" +
"KEY `idx_machines_company` (`company`),;\n" +
"KEY `idx_machines_year` (`year`),;\n" +
"KEY `idx_machines_model` (`model`),;\n" +
"KEY `idx_machines_cpu1` (`cpu1`),;\n" +
"KEY `idx_machines_cpu2` (`cpu2`),;\n" +
"KEY `idx_machines_mhz1` (`mhz1`),;\n" +
"KEY `idx_machines_mhz2` (`mhz2`),;\n" +
"KEY `idx_machines_ram` (`ram`),;\n" +
"KEY `idx_machines_rom` (`rom`),;\n" +
"KEY `idx_machines_gpu` (`gpu`),;\n" +
"KEY `idx_machines_vram` (`vram`),;\n" +
"KEY `idx_machines_colors` (`colors`),;\n" +
"KEY `idx_machines_res` (`res`),;\n" +
public static readonly string Machines = "CREATE TABLE `machines` (;\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,;\n" +
"`company` int(11) NOT NULL DEFAULT '0',;\n" +
"`year` int(11) NOT NULL DEFAULT '0',;\n" +
"`model` char(50) NOT NULL DEFAULT '',;\n" +
"`cpu1` int(11) DEFAULT NULL,;\n" + "`mhz1` int(11) DEFAULT NULL,;\n" +
"`cpu2` int(11) DEFAULT NULL,;\n" +
"`mhz2` decimal(11,2) DEFAULT NULL,;\n" +
"`ram` int(11) NOT NULL DEFAULT '0',;\n" +
"`rom` int(11) NOT NULL DEFAULT '0',;\n" +
"`gpu` int(11) DEFAULT NULL,;\n" +
"`vram` int(11) NOT NULL DEFAULT '0',;\n" +
"`colors` int(11) NOT NULL DEFAULT '0',;\n" +
"`res` char(10) NOT NULL DEFAULT '',;\n" +
"`sound_synth` int(11) NOT NULL DEFAULT '0',;\n" +
"`music_synth` int(11) NOT NULL DEFAULT '0',;\n" +
"`sound_channels` int(11) NOT NULL DEFAULT '0',;\n" +
"`music_channels` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd1` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd2` int(11) DEFAULT NULL,;\n" + "`hdd3` int(11) DEFAULT NULL,;\n" +
"`disk1` int(11) NOT NULL DEFAULT '0',;\n" +
"`cap1` char(25) NOT NULL DEFAULT '0',;\n" +
"`disk2` int(11) DEFAULT NULL,;\n" +
"`cap2` char(25) DEFAULT NULL,;\n" +
"`type` int(11) NOT NULL DEFAULT '0',;\n" + "PRIMARY KEY (`id`),;\n" +
"KEY `idx_machines_company` (`company`),;\n" +
"KEY `idx_machines_year` (`year`),;\n" +
"KEY `idx_machines_model` (`model`),;\n" +
"KEY `idx_machines_cpu1` (`cpu1`),;\n" +
"KEY `idx_machines_cpu2` (`cpu2`),;\n" +
"KEY `idx_machines_mhz1` (`mhz1`),;\n" +
"KEY `idx_machines_mhz2` (`mhz2`),;\n" +
"KEY `idx_machines_ram` (`ram`),;\n" +
"KEY `idx_machines_rom` (`rom`),;\n" +
"KEY `idx_machines_gpu` (`gpu`),;\n" +
"KEY `idx_machines_vram` (`vram`),;\n" +
"KEY `idx_machines_colors` (`colors`),;\n" +
"KEY `idx_machines_res` (`res`),;\n" +
"KEY `idx_machines_sound_synth` (`sound_synth`),;\n" +
"KEY `idx_machines_music_synth` (`music_synth`),;\n" +
"KEY `idx_machines_hdd1` (`hdd1`),;\n" +
"KEY `idx_machines_hdd2` (`hdd2`),;\n" +
"KEY `idx_machines_hdd3` (`hdd3`),;\n" +
"KEY `idx_machines_disk1` (`disk1`),;\n" +
"KEY `idx_machines_disk2` (`disk2`),;\n" +
"KEY `idx_machines_cap1` (`cap1`),;\n" +
"KEY `idx_machines_cap2` (`cap2`),;\n" +
"KEY `idx_machines_hdd1` (`hdd1`),;\n" +
"KEY `idx_machines_hdd2` (`hdd2`),;\n" +
"KEY `idx_machines_hdd3` (`hdd3`),;\n" +
"KEY `idx_machines_disk1` (`disk1`),;\n" +
"KEY `idx_machines_disk2` (`disk2`),;\n" +
"KEY `idx_machines_cap1` (`cap1`),;\n" +
"KEY `idx_machines_cap2` (`cap2`),;\n" +
"KEY `idx_machines_type` (`type`));";
public static readonly string DiskFormats = V13.DiskFormats;
@@ -119,15 +116,15 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string Iso3166NumericValues = V13.Iso3166NumericValues;
public static readonly string MachinesForeignKeys =
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_company` (company) REFERENCES `companies` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_cpu1` (cpu1) REFERENCES `processors` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_cpu2` (cpu2) REFERENCES `processors` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_disk1` (disk1) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_disk2` (disk2) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_gpu` (gpu) REFERENCES `gpus` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd1` (hdd1) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd2` (hdd2) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd3` (hdd3) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_company` (company) REFERENCES `companies` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_cpu1` (cpu1) REFERENCES `processors` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_cpu2` (cpu2) REFERENCES `processors` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_disk1` (disk1) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_disk2` (disk2) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_gpu` (gpu) REFERENCES `gpus` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd1` (hdd1) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd2` (hdd2) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd3` (hdd3) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_music_synth` (music_synth) REFERENCES `sound_synths` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_sound_synth` (sound_synth) REFERENCES `sound_synths` (`id`) ON UPDATE CASCADE;";

View File

@@ -40,48 +40,46 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string Companies = V14.Companies;
public static readonly string Machines = "CREATE TABLE `machines` (;\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,;\n" +
"`company` int(11) NOT NULL DEFAULT '0',;\n" +
"`year` int(11) NOT NULL DEFAULT '0',;\n" +
"`model` char(50) NOT NULL DEFAULT '',;\n" +
"`ram` int(11) NOT NULL DEFAULT '0',;\n" +
"`rom` int(11) NOT NULL DEFAULT '0',;\n" +
"`gpu` int(11) DEFAULT NULL,;\n" +
"`vram` int(11) NOT NULL DEFAULT '0',;\n" +
"`colors` int(11) NOT NULL DEFAULT '0',;\n" +
"`res` char(10) NOT NULL DEFAULT '',;\n" +
"`sound_synth` int(11) NOT NULL DEFAULT '0',;\n" +
"`music_synth` int(11) NOT NULL DEFAULT '0',;\n" +
"`sound_channels` int(11) NOT NULL DEFAULT '0',;\n" +
"`music_channels` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd1` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd2` int(11) DEFAULT NULL,;\n" +
"`hdd3` int(11) DEFAULT NULL,;\n" +
"`disk1` int(11) NOT NULL DEFAULT '0',;\n" +
"`cap1` char(25) NOT NULL DEFAULT '0',;\n" +
"`disk2` int(11) DEFAULT NULL,;\n" +
"`cap2` char(25) DEFAULT NULL,;\n" +
"`type` int(11) NOT NULL DEFAULT '0',;\n" +
"PRIMARY KEY (`id`),;\n" +
"KEY `idx_machines_company` (`company`),;\n" +
"KEY `idx_machines_year` (`year`),;\n" +
"KEY `idx_machines_model` (`model`),;\n" +
"KEY `idx_machines_ram` (`ram`),;\n" +
"KEY `idx_machines_rom` (`rom`),;\n" +
"KEY `idx_machines_gpu` (`gpu`),;\n" +
"KEY `idx_machines_vram` (`vram`),;\n" +
"KEY `idx_machines_colors` (`colors`),;\n" +
"KEY `idx_machines_res` (`res`),;\n" +
public static readonly string Machines = "CREATE TABLE `machines` (;\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,;\n" +
"`company` int(11) NOT NULL DEFAULT '0',;\n" +
"`year` int(11) NOT NULL DEFAULT '0',;\n" +
"`model` char(50) NOT NULL DEFAULT '',;\n" +
"`ram` int(11) NOT NULL DEFAULT '0',;\n" +
"`rom` int(11) NOT NULL DEFAULT '0',;\n" +
"`gpu` int(11) DEFAULT NULL,;\n" +
"`vram` int(11) NOT NULL DEFAULT '0',;\n" +
"`colors` int(11) NOT NULL DEFAULT '0',;\n" +
"`res` char(10) NOT NULL DEFAULT '',;\n" +
"`sound_synth` int(11) NOT NULL DEFAULT '0',;\n" +
"`music_synth` int(11) NOT NULL DEFAULT '0',;\n" +
"`sound_channels` int(11) NOT NULL DEFAULT '0',;\n" +
"`music_channels` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd1` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd2` int(11) DEFAULT NULL,;\n" + "`hdd3` int(11) DEFAULT NULL,;\n" +
"`disk1` int(11) NOT NULL DEFAULT '0',;\n" +
"`cap1` char(25) NOT NULL DEFAULT '0',;\n" +
"`disk2` int(11) DEFAULT NULL,;\n" +
"`cap2` char(25) DEFAULT NULL,;\n" +
"`type` int(11) NOT NULL DEFAULT '0',;\n" + "PRIMARY KEY (`id`),;\n" +
"KEY `idx_machines_company` (`company`),;\n" +
"KEY `idx_machines_year` (`year`),;\n" +
"KEY `idx_machines_model` (`model`),;\n" +
"KEY `idx_machines_ram` (`ram`),;\n" +
"KEY `idx_machines_rom` (`rom`),;\n" +
"KEY `idx_machines_gpu` (`gpu`),;\n" +
"KEY `idx_machines_vram` (`vram`),;\n" +
"KEY `idx_machines_colors` (`colors`),;\n" +
"KEY `idx_machines_res` (`res`),;\n" +
"KEY `idx_machines_sound_synth` (`sound_synth`),;\n" +
"KEY `idx_machines_music_synth` (`music_synth`),;\n" +
"KEY `idx_machines_hdd1` (`hdd1`),;\n" +
"KEY `idx_machines_hdd2` (`hdd2`),;\n" +
"KEY `idx_machines_hdd3` (`hdd3`),;\n" +
"KEY `idx_machines_disk1` (`disk1`),;\n" +
"KEY `idx_machines_disk2` (`disk2`),;\n" +
"KEY `idx_machines_cap1` (`cap1`),;\n" +
"KEY `idx_machines_cap2` (`cap2`),;\n" +
"KEY `idx_machines_hdd1` (`hdd1`),;\n" +
"KEY `idx_machines_hdd2` (`hdd2`),;\n" +
"KEY `idx_machines_hdd3` (`hdd3`),;\n" +
"KEY `idx_machines_disk1` (`disk1`),;\n" +
"KEY `idx_machines_disk2` (`disk2`),;\n" +
"KEY `idx_machines_cap1` (`cap1`),;\n" +
"KEY `idx_machines_cap2` (`cap2`),;\n" +
"KEY `idx_machines_type` (`type`));";
public static readonly string DiskFormats = V14.DiskFormats;
@@ -105,13 +103,13 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string SoundSynths = V14.SoundSynths;
public static readonly string MachinesForeignKeys =
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_company` (company) REFERENCES `companies` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_disk1` (disk1) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_disk2` (disk2) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_gpu` (gpu) REFERENCES `gpus` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd1` (hdd1) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd2` (hdd2) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd3` (hdd3) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_company` (company) REFERENCES `companies` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_disk1` (disk1) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_disk2` (disk2) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_gpu` (gpu) REFERENCES `gpus` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd1` (hdd1) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd2` (hdd2) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd3` (hdd3) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_music_synth` (music_synth) REFERENCES `sound_synths` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_sound_synth` (sound_synth) REFERENCES `sound_synths` (`id`) ON UPDATE CASCADE;";
@@ -131,15 +129,14 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string InstructionSetExtensionsByProcessor = V14.InstructionSetExtensionsByProcessor;
public static readonly string ProcessorsByMachine =
"CREATE TABLE `processors_by_machine` (\n" +
"`processor` INT NOT NULL, \n" +
"`machine` INT NOT NULL,\n" +
"`speed` FLOAT DEFAULT NULL, \n" +
"KEY `idx_processors_by_machine_processor` (`processor`),\n" +
"KEY `idx_processors_by_machine_machine` (`machine`),\n" +
"KEY `idx_processors_by_machine_speed` (`speed`),\n" +
"CONSTRAINT `fk_processors_by_machine_machine` FOREIGN KEY (`machine`) REFERENCES `machines` (`id`) ON UPDATE CASCADE ON DELETE CASCADE,\n" +
"CONSTRAINT `fk_processors_by_machine_processor` FOREIGN KEY (`processor`) REFERENCES `processors` (`id`) ON UPDATE CASCADE ON DELETE CASCADE);";
public static readonly string ProcessorsByMachine = "CREATE TABLE `processors_by_machine` (\n" +
"`processor` INT NOT NULL, \n" +
"`machine` INT NOT NULL,\n" +
"`speed` FLOAT DEFAULT NULL, \n" +
"KEY `idx_processors_by_machine_processor` (`processor`),\n" +
"KEY `idx_processors_by_machine_machine` (`machine`),\n" +
"KEY `idx_processors_by_machine_speed` (`speed`),\n" +
"CONSTRAINT `fk_processors_by_machine_machine` FOREIGN KEY (`machine`) REFERENCES `machines` (`id`) ON UPDATE CASCADE ON DELETE CASCADE,\n" +
"CONSTRAINT `fk_processors_by_machine_processor` FOREIGN KEY (`processor`) REFERENCES `processors` (`id`) ON UPDATE CASCADE ON DELETE CASCADE);";
}
}

View File

@@ -40,46 +40,44 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string Companies = V15.Companies;
public static readonly string Machines = "CREATE TABLE `machines` (;\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,;\n" +
"`company` int(11) NOT NULL DEFAULT '0',;\n" +
"`year` int(11) NOT NULL DEFAULT '0',;\n" +
"`model` char(50) NOT NULL DEFAULT '',;\n" +
"`ram` int(11) NOT NULL DEFAULT '0',;\n" +
"`rom` int(11) NOT NULL DEFAULT '0',;\n" +
"`vram` int(11) NOT NULL DEFAULT '0',;\n" +
"`colors` int(11) NOT NULL DEFAULT '0',;\n" +
"`res` char(10) NOT NULL DEFAULT '',;\n" +
"`sound_synth` int(11) NOT NULL DEFAULT '0',;\n" +
"`music_synth` int(11) NOT NULL DEFAULT '0',;\n" +
"`sound_channels` int(11) NOT NULL DEFAULT '0',;\n" +
"`music_channels` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd1` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd2` int(11) DEFAULT NULL,;\n" +
"`hdd3` int(11) DEFAULT NULL,;\n" +
"`disk1` int(11) NOT NULL DEFAULT '0',;\n" +
"`cap1` char(25) NOT NULL DEFAULT '0',;\n" +
"`disk2` int(11) DEFAULT NULL,;\n" +
"`cap2` char(25) DEFAULT NULL,;\n" +
"`type` int(11) NOT NULL DEFAULT '0',;\n" +
"PRIMARY KEY (`id`),;\n" +
"KEY `idx_machines_company` (`company`),;\n" +
"KEY `idx_machines_year` (`year`),;\n" +
"KEY `idx_machines_model` (`model`),;\n" +
"KEY `idx_machines_ram` (`ram`),;\n" +
"KEY `idx_machines_rom` (`rom`),;\n" +
"KEY `idx_machines_vram` (`vram`),;\n" +
"KEY `idx_machines_colors` (`colors`),;\n" +
"KEY `idx_machines_res` (`res`),;\n" +
public static readonly string Machines = "CREATE TABLE `machines` (;\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,;\n" +
"`company` int(11) NOT NULL DEFAULT '0',;\n" +
"`year` int(11) NOT NULL DEFAULT '0',;\n" +
"`model` char(50) NOT NULL DEFAULT '',;\n" +
"`ram` int(11) NOT NULL DEFAULT '0',;\n" +
"`rom` int(11) NOT NULL DEFAULT '0',;\n" +
"`vram` int(11) NOT NULL DEFAULT '0',;\n" +
"`colors` int(11) NOT NULL DEFAULT '0',;\n" +
"`res` char(10) NOT NULL DEFAULT '',;\n" +
"`sound_synth` int(11) NOT NULL DEFAULT '0',;\n" +
"`music_synth` int(11) NOT NULL DEFAULT '0',;\n" +
"`sound_channels` int(11) NOT NULL DEFAULT '0',;\n" +
"`music_channels` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd1` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd2` int(11) DEFAULT NULL,;\n" + "`hdd3` int(11) DEFAULT NULL,;\n" +
"`disk1` int(11) NOT NULL DEFAULT '0',;\n" +
"`cap1` char(25) NOT NULL DEFAULT '0',;\n" +
"`disk2` int(11) DEFAULT NULL,;\n" +
"`cap2` char(25) DEFAULT NULL,;\n" +
"`type` int(11) NOT NULL DEFAULT '0',;\n" + "PRIMARY KEY (`id`),;\n" +
"KEY `idx_machines_company` (`company`),;\n" +
"KEY `idx_machines_year` (`year`),;\n" +
"KEY `idx_machines_model` (`model`),;\n" +
"KEY `idx_machines_ram` (`ram`),;\n" +
"KEY `idx_machines_rom` (`rom`),;\n" +
"KEY `idx_machines_vram` (`vram`),;\n" +
"KEY `idx_machines_colors` (`colors`),;\n" +
"KEY `idx_machines_res` (`res`),;\n" +
"KEY `idx_machines_sound_synth` (`sound_synth`),;\n" +
"KEY `idx_machines_music_synth` (`music_synth`),;\n" +
"KEY `idx_machines_hdd1` (`hdd1`),;\n" +
"KEY `idx_machines_hdd2` (`hdd2`),;\n" +
"KEY `idx_machines_hdd3` (`hdd3`),;\n" +
"KEY `idx_machines_disk1` (`disk1`),;\n" +
"KEY `idx_machines_disk2` (`disk2`),;\n" +
"KEY `idx_machines_cap1` (`cap1`),;\n" +
"KEY `idx_machines_cap2` (`cap2`),;\n" +
"KEY `idx_machines_hdd1` (`hdd1`),;\n" +
"KEY `idx_machines_hdd2` (`hdd2`),;\n" +
"KEY `idx_machines_hdd3` (`hdd3`),;\n" +
"KEY `idx_machines_disk1` (`disk1`),;\n" +
"KEY `idx_machines_disk2` (`disk2`),;\n" +
"KEY `idx_machines_cap1` (`cap1`),;\n" +
"KEY `idx_machines_cap2` (`cap2`),;\n" +
"KEY `idx_machines_type` (`type`));";
public static readonly string DiskFormats = V15.DiskFormats;
@@ -103,12 +101,12 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string SoundSynths = V15.SoundSynths;
public static readonly string MachinesForeignKeys =
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_company` (company) REFERENCES `companies` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_disk1` (disk1) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_disk2` (disk2) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd1` (hdd1) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd2` (hdd2) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd3` (hdd3) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_company` (company) REFERENCES `companies` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_disk1` (disk1) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_disk2` (disk2) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd1` (hdd1) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd2` (hdd2) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd3` (hdd3) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_music_synth` (music_synth) REFERENCES `sound_synths` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_sound_synth` (sound_synth) REFERENCES `sound_synths` (`id`) ON UPDATE CASCADE;";
@@ -130,13 +128,11 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string ProcessorsByMachine = V15.ProcessorsByMachine;
public static readonly string GpusByMachine =
"CREATE TABLE `gpus_by_machine` (\n" +
"`gpu` INT NOT NULL, \n" +
"`machine` INT NOT NULL,\n" +
"KEY `idx_gpus_by_machine_gpus` (`gpu`),\n" +
"KEY `idx_gpus_by_machine_machine` (`machine`),\n" +
"CONSTRAINT `fk_gpus_by_machine_machine` FOREIGN KEY (`machine`) REFERENCES `machines` (`id`) ON UPDATE CASCADE ON DELETE CASCADE,\n" +
"CONSTRAINT `fk_gpus_by_machine_gpu` FOREIGN KEY (`gpu`) REFERENCES `gpus` (`id`) ON UPDATE CASCADE ON DELETE CASCADE);";
public static readonly string GpusByMachine = "CREATE TABLE `gpus_by_machine` (\n" + "`gpu` INT NOT NULL, \n" +
"`machine` INT NOT NULL,\n" +
"KEY `idx_gpus_by_machine_gpus` (`gpu`),\n" +
"KEY `idx_gpus_by_machine_machine` (`machine`),\n" +
"CONSTRAINT `fk_gpus_by_machine_machine` FOREIGN KEY (`machine`) REFERENCES `machines` (`id`) ON UPDATE CASCADE ON DELETE CASCADE,\n" +
"CONSTRAINT `fk_gpus_by_machine_gpu` FOREIGN KEY (`gpu`) REFERENCES `gpus` (`id`) ON UPDATE CASCADE ON DELETE CASCADE);";
}
}

View File

@@ -40,40 +40,38 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string Companies = V16.Companies;
public static readonly string Machines = "CREATE TABLE `machines` (;\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,;\n" +
public static readonly string Machines = "CREATE TABLE `machines` (;\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,;\n" +
"`company` int(11) NOT NULL DEFAULT '0',;\n" +
"`year` int(11) NOT NULL DEFAULT '0',;\n" +
"`model` char(50) NOT NULL DEFAULT '',;\n" +
"`ram` int(11) NOT NULL DEFAULT '0',;\n" +
"`rom` int(11) NOT NULL DEFAULT '0',;\n" +
"`vram` int(11) NOT NULL DEFAULT '0',;\n" +
"`colors` int(11) NOT NULL DEFAULT '0',;\n" +
"`res` char(10) NOT NULL DEFAULT '',;\n" +
"`hdd1` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd2` int(11) DEFAULT NULL,;\n" +
"`hdd3` int(11) DEFAULT NULL,;\n" +
"`disk1` int(11) NOT NULL DEFAULT '0',;\n" +
"`cap1` char(25) NOT NULL DEFAULT '0',;\n" +
"`disk2` int(11) DEFAULT NULL,;\n" +
"`cap2` char(25) DEFAULT NULL,;\n" +
"`type` int(11) NOT NULL DEFAULT '0',;\n" +
"PRIMARY KEY (`id`),;\n" +
"`year` int(11) NOT NULL DEFAULT '0',;\n" +
"`model` char(50) NOT NULL DEFAULT '',;\n" +
"`ram` int(11) NOT NULL DEFAULT '0',;\n" +
"`rom` int(11) NOT NULL DEFAULT '0',;\n" +
"`vram` int(11) NOT NULL DEFAULT '0',;\n" +
"`colors` int(11) NOT NULL DEFAULT '0',;\n" +
"`res` char(10) NOT NULL DEFAULT '',;\n" +
"`hdd1` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd2` int(11) DEFAULT NULL,;\n" + "`hdd3` int(11) DEFAULT NULL,;\n" +
"`disk1` int(11) NOT NULL DEFAULT '0',;\n" +
"`cap1` char(25) NOT NULL DEFAULT '0',;\n" +
"`disk2` int(11) DEFAULT NULL,;\n" +
"`cap2` char(25) DEFAULT NULL,;\n" +
"`type` int(11) NOT NULL DEFAULT '0',;\n" + "PRIMARY KEY (`id`),;\n" +
"KEY `idx_machines_company` (`company`),;\n" +
"KEY `idx_machines_year` (`year`),;\n" +
"KEY `idx_machines_model` (`model`),;\n" +
"KEY `idx_machines_ram` (`ram`),;\n" +
"KEY `idx_machines_rom` (`rom`),;\n" +
"KEY `idx_machines_vram` (`vram`),;\n" +
"KEY `idx_machines_colors` (`colors`),;\n" +
"KEY `idx_machines_res` (`res`),;\n" +
"KEY `idx_machines_hdd1` (`hdd1`),;\n" +
"KEY `idx_machines_hdd2` (`hdd2`),;\n" +
"KEY `idx_machines_hdd3` (`hdd3`),;\n" +
"KEY `idx_machines_disk1` (`disk1`),;\n" +
"KEY `idx_machines_disk2` (`disk2`),;\n" +
"KEY `idx_machines_cap1` (`cap1`),;\n" +
"KEY `idx_machines_cap2` (`cap2`),;\n" +
"KEY `idx_machines_year` (`year`),;\n" +
"KEY `idx_machines_model` (`model`),;\n" +
"KEY `idx_machines_ram` (`ram`),;\n" +
"KEY `idx_machines_rom` (`rom`),;\n" +
"KEY `idx_machines_vram` (`vram`),;\n" +
"KEY `idx_machines_colors` (`colors`),;\n" +
"KEY `idx_machines_res` (`res`),;\n" +
"KEY `idx_machines_hdd1` (`hdd1`),;\n" +
"KEY `idx_machines_hdd2` (`hdd2`),;\n" +
"KEY `idx_machines_hdd3` (`hdd3`),;\n" +
"KEY `idx_machines_disk1` (`disk1`),;\n" +
"KEY `idx_machines_disk2` (`disk2`),;\n" +
"KEY `idx_machines_cap1` (`cap1`),;\n" +
"KEY `idx_machines_cap2` (`cap2`),;\n" +
"KEY `idx_machines_type` (`type`));";
public static readonly string DiskFormats = V16.DiskFormats;
@@ -98,10 +96,10 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string MachinesForeignKeys =
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_company` (company) REFERENCES `companies` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_disk1` (disk1) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_disk2` (disk2) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd1` (hdd1) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd2` (hdd2) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_disk1` (disk1) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_disk2` (disk2) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd1` (hdd1) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd2` (hdd2) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" +
"ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd3` (hdd3) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;";
public static readonly string Iso3166Numeric = V16.Iso3166Numeric;
@@ -124,13 +122,11 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string GpusByMachine = V16.GpusByMachine;
public static readonly string SoundByMachine =
"CREATE TABLE `sound_by_machine` (\n" +
"`sound_synth` INT NOT NULL, \n" +
"`machine` INT NOT NULL,\n" +
"KEY `idx_sound_by_machine_sound_synth` (`sound_synth`),\n" +
"KEY `idx_sound_by_machine_machine` (`machine`),\n" +
"CONSTRAINT `fk_sound_by_machine_machine` FOREIGN KEY (`machine`) REFERENCES `machines` (`id`) ON UPDATE CASCADE ON DELETE CASCADE,\n" +
"CONSTRAINT `fk_sound_by_machine_sound_synth` FOREIGN KEY (`sound_synth`) REFERENCES `sound_synths` (`id`) ON UPDATE CASCADE ON DELETE CASCADE);";
public static readonly string SoundByMachine = "CREATE TABLE `sound_by_machine` (\n" +
"`sound_synth` INT NOT NULL, \n" + "`machine` INT NOT NULL,\n" +
"KEY `idx_sound_by_machine_sound_synth` (`sound_synth`),\n" +
"KEY `idx_sound_by_machine_machine` (`machine`),\n" +
"CONSTRAINT `fk_sound_by_machine_machine` FOREIGN KEY (`machine`) REFERENCES `machines` (`id`) ON UPDATE CASCADE ON DELETE CASCADE,\n" +
"CONSTRAINT `fk_sound_by_machine_sound_synth` FOREIGN KEY (`sound_synth`) REFERENCES `sound_synths` (`id`) ON UPDATE CASCADE ON DELETE CASCADE);";
}
}

View File

@@ -40,34 +40,32 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string Companies = V17.Companies;
public static readonly string Machines = "CREATE TABLE `machines` (;\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,;\n" +
public static readonly string Machines = "CREATE TABLE `machines` (;\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,;\n" +
"`company` int(11) NOT NULL DEFAULT '0',;\n" +
"`year` int(11) NOT NULL DEFAULT '0',;\n" +
"`model` char(50) NOT NULL DEFAULT '',;\n" +
"`colors` int(11) NOT NULL DEFAULT '0',;\n" +
"`res` char(10) NOT NULL DEFAULT '',;\n" +
"`hdd1` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd2` int(11) DEFAULT NULL,;\n" +
"`hdd3` int(11) DEFAULT NULL,;\n" +
"`disk1` int(11) NOT NULL DEFAULT '0',;\n" +
"`cap1` char(25) NOT NULL DEFAULT '0',;\n" +
"`disk2` int(11) DEFAULT NULL,;\n" +
"`cap2` char(25) DEFAULT NULL,;\n" +
"`type` int(11) NOT NULL DEFAULT '0',;\n" +
"PRIMARY KEY (`id`),;\n" +
"`year` int(11) NOT NULL DEFAULT '0',;\n" +
"`model` char(50) NOT NULL DEFAULT '',;\n" +
"`colors` int(11) NOT NULL DEFAULT '0',;\n" +
"`res` char(10) NOT NULL DEFAULT '',;\n" +
"`hdd1` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd2` int(11) DEFAULT NULL,;\n" + "`hdd3` int(11) DEFAULT NULL,;\n" +
"`disk1` int(11) NOT NULL DEFAULT '0',;\n" +
"`cap1` char(25) NOT NULL DEFAULT '0',;\n" +
"`disk2` int(11) DEFAULT NULL,;\n" +
"`cap2` char(25) DEFAULT NULL,;\n" +
"`type` int(11) NOT NULL DEFAULT '0',;\n" + "PRIMARY KEY (`id`),;\n" +
"KEY `idx_machines_company` (`company`),;\n" +
"KEY `idx_machines_year` (`year`),;\n" +
"KEY `idx_machines_model` (`model`),;\n" +
"KEY `idx_machines_colors` (`colors`),;\n" +
"KEY `idx_machines_res` (`res`),;\n" +
"KEY `idx_machines_hdd1` (`hdd1`),;\n" +
"KEY `idx_machines_hdd2` (`hdd2`),;\n" +
"KEY `idx_machines_hdd3` (`hdd3`),;\n" +
"KEY `idx_machines_disk1` (`disk1`),;\n" +
"KEY `idx_machines_disk2` (`disk2`),;\n" +
"KEY `idx_machines_cap1` (`cap1`),;\n" +
"KEY `idx_machines_cap2` (`cap2`),;\n" +
"KEY `idx_machines_year` (`year`),;\n" +
"KEY `idx_machines_model` (`model`),;\n" +
"KEY `idx_machines_colors` (`colors`),;\n" +
"KEY `idx_machines_res` (`res`),;\n" +
"KEY `idx_machines_hdd1` (`hdd1`),;\n" +
"KEY `idx_machines_hdd2` (`hdd2`),;\n" +
"KEY `idx_machines_hdd3` (`hdd3`),;\n" +
"KEY `idx_machines_disk1` (`disk1`),;\n" +
"KEY `idx_machines_disk2` (`disk2`),;\n" +
"KEY `idx_machines_cap1` (`cap1`),;\n" +
"KEY `idx_machines_cap2` (`cap2`),;\n" +
"KEY `idx_machines_type` (`type`));";
public static readonly string DiskFormats = V17.DiskFormats;

View File

@@ -40,30 +40,28 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string Companies = V18.Companies;
public static readonly string Machines = "CREATE TABLE `machines` (;\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,;\n" +
public static readonly string Machines = "CREATE TABLE `machines` (;\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,;\n" +
"`company` int(11) NOT NULL DEFAULT '0',;\n" +
"`year` int(11) NOT NULL DEFAULT '0',;\n" +
"`model` char(50) NOT NULL DEFAULT '',;\n" +
"`hdd1` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd2` int(11) DEFAULT NULL,;\n" +
"`hdd3` int(11) DEFAULT NULL,;\n" +
"`disk1` int(11) NOT NULL DEFAULT '0',;\n" +
"`cap1` char(25) NOT NULL DEFAULT '0',;\n" +
"`disk2` int(11) DEFAULT NULL,;\n" +
"`cap2` char(25) DEFAULT NULL,;\n" +
"`type` int(11) NOT NULL DEFAULT '0',;\n" +
"PRIMARY KEY (`id`),;\n" +
"`year` int(11) NOT NULL DEFAULT '0',;\n" +
"`model` char(50) NOT NULL DEFAULT '',;\n" +
"`hdd1` int(11) NOT NULL DEFAULT '0',;\n" +
"`hdd2` int(11) DEFAULT NULL,;\n" + "`hdd3` int(11) DEFAULT NULL,;\n" +
"`disk1` int(11) NOT NULL DEFAULT '0',;\n" +
"`cap1` char(25) NOT NULL DEFAULT '0',;\n" +
"`disk2` int(11) DEFAULT NULL,;\n" +
"`cap2` char(25) DEFAULT NULL,;\n" +
"`type` int(11) NOT NULL DEFAULT '0',;\n" + "PRIMARY KEY (`id`),;\n" +
"KEY `idx_machines_company` (`company`),;\n" +
"KEY `idx_machines_year` (`year`),;\n" +
"KEY `idx_machines_model` (`model`),;\n" +
"KEY `idx_machines_hdd1` (`hdd1`),;\n" +
"KEY `idx_machines_hdd2` (`hdd2`),;\n" +
"KEY `idx_machines_hdd3` (`hdd3`),;\n" +
"KEY `idx_machines_disk1` (`disk1`),;\n" +
"KEY `idx_machines_disk2` (`disk2`),;\n" +
"KEY `idx_machines_cap1` (`cap1`),;\n" +
"KEY `idx_machines_cap2` (`cap2`),;\n" +
"KEY `idx_machines_year` (`year`),;\n" +
"KEY `idx_machines_model` (`model`),;\n" +
"KEY `idx_machines_hdd1` (`hdd1`),;\n" +
"KEY `idx_machines_hdd2` (`hdd2`),;\n" +
"KEY `idx_machines_hdd3` (`hdd3`),;\n" +
"KEY `idx_machines_disk1` (`disk1`),;\n" +
"KEY `idx_machines_disk2` (`disk2`),;\n" +
"KEY `idx_machines_cap1` (`cap1`),;\n" +
"KEY `idx_machines_cap2` (`cap2`),;\n" +
"KEY `idx_machines_type` (`type`));";
public static readonly string DiskFormats = V18.DiskFormats;
@@ -112,29 +110,26 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string MemoryByMachine = V18.MemoryByMachine;
public static readonly string Resolutions =
"CREATE TABLE `resolutions` (\n" +
"`id` INT NOT NULL AUTO_INCREMENT,\n" +
"`width` INT NOT NULL DEFAULT 0,\n" +
"`height` INT NOT NULL DEFAULT 0,\n" +
"`colors` BIGINT DEFAULT NULL,\n" +
"`palette` BIGINT DEFAULT NULL,\n" +
"`chars` BOOL NOT NULL DEFAULT 0,\n" + "PRIMARY KEY (`id`),\n" +
"KEY `idx_resolutions_width` (`width`),\n" +
"KEY `idx_resolutions_height` (`height`),\n" +
"KEY `idx_resolutions_colors` (`colors`),\n" +
"KEY `idx_resolutions_palette` (`palette`),\n" +
"INDEX `idx_resolutions_resolution` (`width`,`height`),\n" +
"INDEX `idx_resolutions_resolution_with_color` (`width`,`height`,`colors`),\n" +
"INDEX `idx_resolutions_resolution_with_color_and_palette` (`width`,`height`,`colors`,`palette`));";
public static readonly string Resolutions = "CREATE TABLE `resolutions` (\n" +
"`id` INT NOT NULL AUTO_INCREMENT,\n" +
"`width` INT NOT NULL DEFAULT 0,\n" +
"`height` INT NOT NULL DEFAULT 0,\n" +
"`colors` BIGINT DEFAULT NULL,\n" +
"`palette` BIGINT DEFAULT NULL,\n" +
"`chars` BOOL NOT NULL DEFAULT 0,\n" + "PRIMARY KEY (`id`),\n" +
"KEY `idx_resolutions_width` (`width`),\n" +
"KEY `idx_resolutions_height` (`height`),\n" +
"KEY `idx_resolutions_colors` (`colors`),\n" +
"KEY `idx_resolutions_palette` (`palette`),\n" +
"INDEX `idx_resolutions_resolution` (`width`,`height`),\n" +
"INDEX `idx_resolutions_resolution_with_color` (`width`,`height`,`colors`),\n" +
"INDEX `idx_resolutions_resolution_with_color_and_palette` (`width`,`height`,`colors`,`palette`));";
public static readonly string ResolutionsByGpu =
"CREATE TABLE `resolutions_by_gpu` (\n" +
"`gpu` INT NOT NULL,\n" +
"`resolution` INT NOT NULL,\n" +
"KEY `idx_resolutions_by_gpu_gpu` (`gpu`),\n" +
"KEY `idx_resolutions_by_gpu_resolution` (`resolution`),\n" +
"CONSTRAINT `fk_resolutions_by_gpu_gpu` FOREIGN KEY (`gpu`) REFERENCES `gpus` (`id`) ON UPDATE CASCADE ON DELETE CASCADE,\n" +
"CONSTRAINT `fk_resolutions_by_gpu_resolution` FOREIGN KEY (`resolution`) REFERENCES `resolutions` (`id`) ON UPDATE CASCADE ON DELETE CASCADE);";
public static readonly string ResolutionsByGpu = "CREATE TABLE `resolutions_by_gpu` (\n" +
"`gpu` INT NOT NULL,\n" + "`resolution` INT NOT NULL,\n" +
"KEY `idx_resolutions_by_gpu_gpu` (`gpu`),\n" +
"KEY `idx_resolutions_by_gpu_resolution` (`resolution`),\n" +
"CONSTRAINT `fk_resolutions_by_gpu_gpu` FOREIGN KEY (`gpu`) REFERENCES `gpus` (`id`) ON UPDATE CASCADE ON DELETE CASCADE,\n" +
"CONSTRAINT `fk_resolutions_by_gpu_resolution` FOREIGN KEY (`resolution`) REFERENCES `resolutions` (`id`) ON UPDATE CASCADE ON DELETE CASCADE);";
}
}

View File

@@ -40,16 +40,15 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string Companies = V19.Companies;
public static readonly string Machines = "CREATE TABLE `machines` (;\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,;\n" +
public static readonly string Machines = "CREATE TABLE `machines` (;\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,;\n" +
"`company` int(11) NOT NULL DEFAULT '0',;\n" +
"`year` int(11) NOT NULL DEFAULT '0',;\n" +
"`model` char(50) NOT NULL DEFAULT '',;\n" +
"`type` int(11) NOT NULL DEFAULT '0',;\n" +
"PRIMARY KEY (`id`),;\n" +
"`year` int(11) NOT NULL DEFAULT '0',;\n" +
"`model` char(50) NOT NULL DEFAULT '',;\n" +
"`type` int(11) NOT NULL DEFAULT '0',;\n" + "PRIMARY KEY (`id`),;\n" +
"KEY `idx_machines_company` (`company`),;\n" +
"KEY `idx_machines_year` (`year`),;\n" +
"KEY `idx_machines_model` (`model`),;\n" +
"KEY `idx_machines_year` (`year`),;\n" +
"KEY `idx_machines_model` (`model`),;\n" +
"KEY `idx_machines_type` (`type`));";
public static readonly string Forbidden = V19.Forbidden;

View File

@@ -40,16 +40,15 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string Companies = V20.Companies;
public static readonly string Machines = "CREATE TABLE `machines` (;\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,;\n" +
"`company` int(11) NOT NULL DEFAULT '0',;\n" +
"`introduced` DATETIME NULL,;\n" +
"`model` char(50) NOT NULL DEFAULT '',;\n" +
"`type` int(11) NOT NULL DEFAULT '0',;\n" +
"PRIMARY KEY (`id`),;\n" +
"KEY `idx_machines_company` (`company`),;\n" +
public static readonly string Machines = "CREATE TABLE `machines` (;\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,;\n" +
"`company` int(11) NOT NULL DEFAULT '0',;\n" +
"`introduced` DATETIME NULL,;\n" +
"`model` char(50) NOT NULL DEFAULT '',;\n" +
"`type` int(11) NOT NULL DEFAULT '0',;\n" + "PRIMARY KEY (`id`),;\n" +
"KEY `idx_machines_company` (`company`),;\n" +
"KEY `idx_machines_introduced` (`introduced`),;\n" +
"KEY `idx_machines_model` (`model`),;\n" +
"KEY `idx_machines_model` (`model`),;\n" +
"KEY `idx_machines_type` (`type`));";
public static readonly string Forbidden = V20.Forbidden;

View File

@@ -40,20 +40,19 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string Companies = V21.Companies;
public static readonly string Machines = "CREATE TABLE `machines` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`company` int(11) NOT NULL DEFAULT '0',\n" +
"`name` varchar(255) NOT NULL,\n" +
"`type` int(11) NOT NULL DEFAULT '0',\n" +
"`introduced` datetime DEFAULT NULL,\n" +
"`family` int(11) DEFAULT NULL,\n" +
"`model` varchar(50) DEFAULT NULL,\n" +
"PRIMARY KEY (`id`),\n" +
"KEY `idx_machines_company` (`company`),\n" +
"KEY `idx_machines_type` (`type`),\n" +
public static readonly string Machines = "CREATE TABLE `machines` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`company` int(11) NOT NULL DEFAULT '0',\n" +
"`name` varchar(255) NOT NULL,\n" +
"`type` int(11) NOT NULL DEFAULT '0',\n" +
"`introduced` datetime DEFAULT NULL,\n" +
"`family` int(11) DEFAULT NULL,\n" +
"`model` varchar(50) DEFAULT NULL,\n" + "PRIMARY KEY (`id`),\n" +
"KEY `idx_machines_company` (`company`),\n" +
"KEY `idx_machines_type` (`type`),\n" +
"KEY `idx_machines_introduced` (`introduced`),\n" +
"KEY `idx_machines_family` (`family`),\n" +
"KEY `idx_machines_name` (`name`),\n" +
"KEY `idx_machines_family` (`family`),\n" +
"KEY `idx_machines_name` (`name`),\n" +
"KEY `idx_machines_model` (`model`));";
public static readonly string Forbidden = V21.Forbidden;
@@ -108,13 +107,12 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string StorageByMachine = V21.StorageByMachine;
public static readonly string MachineFamilies = "CREATE TABLE `machine_families` (\n" +
"`id` INT NOT NULL AUTO_INCREMENT,\n" +
"`company` INT NOT NULL,\n" +
"`name` VARCHAR(255) NOT NULL,\n" +
"PRIMARY KEY (`id`),\n" +
public static readonly string MachineFamilies = "CREATE TABLE `machine_families` (\n" +
"`id` INT NOT NULL AUTO_INCREMENT,\n" +
"`company` INT NOT NULL,\n" +
"`name` VARCHAR(255) NOT NULL,\n" + "PRIMARY KEY (`id`),\n" +
"KEY `idx_machine_families_company` (`company`),\n" +
"KEY `idx_machine_families_name` (`name`),\n" +
"KEY `idx_machine_families_name` (`name`),\n" +
"CONSTRAINT `fk_machine_families_company` FOREIGN KEY (`company`) REFERENCES `companies` (`id`) ON UPDATE CASCADE ON DELETE CASCADE);";
}
}

View File

@@ -29,13 +29,12 @@ namespace Marechai.Database.Schemas.Sql
{
public static readonly string Admins = V3.Admins + "\n" + "CREATE INDEX idx_admins_user ON admins (user);";
public static readonly string BrowserTests =
V3.BrowserTests + "\n" +
"CREATE INDEX idx_browser_tests_user_agent ON browser_tests (user_agent);\n" +
"CREATE INDEX idx_browser_tests_browser ON browser_tests (browser);\n" +
"CREATE INDEX idx_browser_tests_version ON browser_tests (version);\n" +
"CREATE INDEX idx_browser_tests_os ON browser_tests (os);\n" +
"CREATE INDEX idx_browser_tests_platform ON browser_tests (platform);";
public static readonly string BrowserTests = V3.BrowserTests + "\n" +
"CREATE INDEX idx_browser_tests_user_agent ON browser_tests (user_agent);\n" +
"CREATE INDEX idx_browser_tests_browser ON browser_tests (browser);\n" +
"CREATE INDEX idx_browser_tests_version ON browser_tests (version);\n" +
"CREATE INDEX idx_browser_tests_os ON browser_tests (os);\n" +
"CREATE INDEX idx_browser_tests_platform ON browser_tests (platform);";
public static readonly string MarechaiDb = @"CREATE TABLE `marechai_db` (
`id` int(11) NOT NULL AUTO_INCREMENT,
@@ -48,113 +47,105 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string Companies =
V3.Companies + "\n" + "CREATE INDEX idx_companies_name ON companies (name);";
public static readonly string Computers =
V3.Computers + "\n" +
"CREATE INDEX idx_computers_company ON computers (company);\n" +
"CREATE INDEX idx_computers_year ON computers (year);\n" +
"CREATE INDEX idx_computers_model ON computers (model);\n" +
"CREATE INDEX idx_computers_cpu1 ON computers (cpu1);\n" +
"CREATE INDEX idx_computers_cpu2 ON computers (cpu2);\n" +
"CREATE INDEX idx_computers_mhz1 ON computers (mhz1);\n" +
"CREATE INDEX idx_computers_mhz2 ON computers (mhz2);\n" +
"CREATE INDEX idx_computers_bits ON computers (bits);\n" +
"CREATE INDEX idx_computers_ram ON computers (ram);\n" +
"CREATE INDEX idx_computers_rom ON computers (rom);\n" +
"CREATE INDEX idx_computers_gpu ON computers (gpu);\n" +
"CREATE INDEX idx_computers_vram ON computers (vram);\n" +
"CREATE INDEX idx_computers_colors ON computers (colors);\n" +
"CREATE INDEX idx_computers_res ON computers (res);\n" +
"CREATE INDEX idx_computers_sound_synth ON computers (sound_synth);\n" +
"CREATE INDEX idx_computers_music_synth ON computers (music_synth);\n" +
"CREATE INDEX idx_computers_hdd1 ON computers (hdd1);\n" +
"CREATE INDEX idx_computers_hdd2 ON computers (hdd2);\n" +
"CREATE INDEX idx_computers_hdd3 ON computers (hdd3);\n" +
"CREATE INDEX idx_computers_disk1 ON computers (disk1);\n" +
"CREATE INDEX idx_computers_disk2 ON computers (disk2);\n" +
"CREATE INDEX idx_computers_cap1 ON computers (cap1);\n" +
"CREATE INDEX idx_computers_cap2 ON computers (cap2);";
public static readonly string Computers = V3.Computers + "\n" +
"CREATE INDEX idx_computers_company ON computers (company);\n" +
"CREATE INDEX idx_computers_year ON computers (year);\n" +
"CREATE INDEX idx_computers_model ON computers (model);\n" +
"CREATE INDEX idx_computers_cpu1 ON computers (cpu1);\n" +
"CREATE INDEX idx_computers_cpu2 ON computers (cpu2);\n" +
"CREATE INDEX idx_computers_mhz1 ON computers (mhz1);\n" +
"CREATE INDEX idx_computers_mhz2 ON computers (mhz2);\n" +
"CREATE INDEX idx_computers_bits ON computers (bits);\n" +
"CREATE INDEX idx_computers_ram ON computers (ram);\n" +
"CREATE INDEX idx_computers_rom ON computers (rom);\n" +
"CREATE INDEX idx_computers_gpu ON computers (gpu);\n" +
"CREATE INDEX idx_computers_vram ON computers (vram);\n" +
"CREATE INDEX idx_computers_colors ON computers (colors);\n" +
"CREATE INDEX idx_computers_res ON computers (res);\n" +
"CREATE INDEX idx_computers_sound_synth ON computers (sound_synth);\n" +
"CREATE INDEX idx_computers_music_synth ON computers (music_synth);\n" +
"CREATE INDEX idx_computers_hdd1 ON computers (hdd1);\n" +
"CREATE INDEX idx_computers_hdd2 ON computers (hdd2);\n" +
"CREATE INDEX idx_computers_hdd3 ON computers (hdd3);\n" +
"CREATE INDEX idx_computers_disk1 ON computers (disk1);\n" +
"CREATE INDEX idx_computers_disk2 ON computers (disk2);\n" +
"CREATE INDEX idx_computers_cap1 ON computers (cap1);\n" +
"CREATE INDEX idx_computers_cap2 ON computers (cap2);";
public static readonly string Consoles = V3.Consoles +
"\n" +
"CREATE INDEX idx_consoles_company ON consoles (company);\n" +
"CREATE INDEX idx_consoles_year ON consoles (year);\n" +
"CREATE INDEX idx_consoles_model ON consoles (model);\n" +
"CREATE INDEX idx_consoles_cpu1 ON consoles (cpu1);\n" +
"CREATE INDEX idx_consoles_cpu2 ON consoles (cpu2);\n" +
"CREATE INDEX idx_consoles_mhz1 ON consoles (mhz1);\n" +
"CREATE INDEX idx_consoles_mhz2 ON consoles (mhz2);\n" +
"CREATE INDEX idx_consoles_bits ON consoles (bits);\n" +
"CREATE INDEX idx_consoles_ram ON consoles (ram);\n" +
"CREATE INDEX idx_consoles_rom ON consoles (rom);\n" +
"CREATE INDEX idx_consoles_gpu ON consoles (gpu);\n" +
"CREATE INDEX idx_consoles_vram ON consoles (vram);\n" +
"CREATE INDEX idx_consoles_colors ON consoles (colors);\n" +
"CREATE INDEX idx_consoles_res ON consoles (res);\n" +
public static readonly string Consoles = V3.Consoles + "\n" +
"CREATE INDEX idx_consoles_company ON consoles (company);\n" +
"CREATE INDEX idx_consoles_year ON consoles (year);\n" +
"CREATE INDEX idx_consoles_model ON consoles (model);\n" +
"CREATE INDEX idx_consoles_cpu1 ON consoles (cpu1);\n" +
"CREATE INDEX idx_consoles_cpu2 ON consoles (cpu2);\n" +
"CREATE INDEX idx_consoles_mhz1 ON consoles (mhz1);\n" +
"CREATE INDEX idx_consoles_mhz2 ON consoles (mhz2);\n" +
"CREATE INDEX idx_consoles_bits ON consoles (bits);\n" +
"CREATE INDEX idx_consoles_ram ON consoles (ram);\n" +
"CREATE INDEX idx_consoles_rom ON consoles (rom);\n" +
"CREATE INDEX idx_consoles_gpu ON consoles (gpu);\n" +
"CREATE INDEX idx_consoles_vram ON consoles (vram);\n" +
"CREATE INDEX idx_consoles_colors ON consoles (colors);\n" +
"CREATE INDEX idx_consoles_res ON consoles (res);\n" +
"CREATE INDEX idx_consoles_sound_synth ON consoles (sound_synth);\n" +
"CREATE INDEX idx_consoles_music_synth ON consoles (music_synth);\n" +
"CREATE INDEX idx_consoles_palette ON consoles (palette);\n" +
"CREATE INDEX idx_consoles_format ON consoles (format);\n" +
"CREATE INDEX idx_consoles_palette ON consoles (palette);\n" +
"CREATE INDEX idx_consoles_format ON consoles (format);\n" +
"CREATE INDEX idx_consoles_cap ON consoles (cap);";
public static readonly string DiskFormats = V3.DiskFormats + "\n" +
"CREATE INDEX idx_disk_formats_description ON disk_formats (description);";
public static readonly string Forbidden = V3.Forbidden +
"\n" +
public static readonly string Forbidden = V3.Forbidden + "\n" +
"CREATE INDEX idx_forbidden_browser ON forbidden (browser);\n" +
"CREATE INDEX idx_forbidden_date ON forbidden (date);\n" +
"CREATE INDEX idx_forbidden_ip ON forbidden (ip);\n" +
"CREATE INDEX idx_forbidden_date ON forbidden (date);\n" +
"CREATE INDEX idx_forbidden_ip ON forbidden (ip);\n" +
"CREATE INDEX idx_forbidden_referer ON forbidden (referer);";
public static readonly string Gpus = V3.Gpus + "\n" + "CREATE INDEX idx_gpus_name ON gpus (name);";
public static readonly string Logs = V3.Logs + "\n" +
"CREATE INDEX idx_log_browser ON log (browser);\n" +
"CREATE INDEX idx_log_date ON log (date);\n" +
"CREATE INDEX idx_log_ip ON log (ip);\n" +
public static readonly string Logs = V3.Logs + "\n" + "CREATE INDEX idx_log_browser ON log (browser);\n" +
"CREATE INDEX idx_log_date ON log (date);\n" +
"CREATE INDEX idx_log_ip ON log (ip);\n" +
"CREATE INDEX idx_log_referer ON log (referer);";
public static readonly string MoneyDonations =
V3.MoneyDonations + "\n" +
"CREATE INDEX idx_money_donations_donator ON money_donations (donator);\n" +
"CREATE INDEX idx_money_donations_quantity ON money_donations (quantity);";
public static readonly string MoneyDonations = V3.MoneyDonations + "\n" +
"CREATE INDEX idx_money_donations_donator ON money_donations (donator);\n" +
"CREATE INDEX idx_money_donations_quantity ON money_donations (quantity);";
public static readonly string MusicSynths =
V3.MusicSynths + "\n" + "CREATE INDEX idx_music_synts_name ON music_synths (name);";
public static readonly string News = V3.News + "\n" +
"CREATE INDEX idx_news_date ON news (date);\n" +
public static readonly string News = V3.News + "\n" + "CREATE INDEX idx_news_date ON news (date);\n" +
"CREATE INDEX idx_news_type ON news (type);\n" +
"CREATE INDEX idx_news_ip ON news (added_id);";
public static readonly string OwnedComputers =
V3.OwnedComputers + "\n" +
"CREATE INDEX idx_owned_computers_db_id ON owned_computers (db_id);\n" +
"CREATE INDEX idx_owned_computers_date ON owned_computers (date);\n" +
"CREATE INDEX idx_owned_computers_status ON owned_computers (status);\n" +
"CREATE INDEX idx_owned_computers_trade ON owned_computers (trade);\n" +
"CREATE INDEX idx_owned_computers_boxed ON owned_computers (boxed);\n" +
"CREATE INDEX idx_owned_computers_manuals ON owned_computers (manuals);\n" +
"CREATE INDEX idx_owned_computers_cpu1 ON owned_computers (cpu1);\n" +
"CREATE INDEX idx_owned_computers_cpu2 ON owned_computers (cpu2);\n" +
"CREATE INDEX idx_owned_computers_mhz1 ON owned_computers (mhz1);\n" +
"CREATE INDEX idx_owned_computers_mhz2 ON owned_computers (mhz2);\n" +
"CREATE INDEX idx_owned_computers_ram ON owned_computers (ram);\n" +
"CREATE INDEX idx_owned_computers_vram ON owned_computers (vram);\n" +
"CREATE INDEX idx_owned_computers_rigid ON owned_computers (rigid);\n" +
"CREATE INDEX idx_owned_computers_disk1 ON owned_computers (disk1);\n" +
"CREATE INDEX idx_owned_computers_disk2 ON owned_computers (disk2);\n" +
"CREATE INDEX idx_owned_computers_cap1 ON owned_computers (cap1);\n" +
"CREATE INDEX idx_owned_computers_cap2 ON owned_computers (cap2);";
public static readonly string OwnedComputers = V3.OwnedComputers + "\n" +
"CREATE INDEX idx_owned_computers_db_id ON owned_computers (db_id);\n" +
"CREATE INDEX idx_owned_computers_date ON owned_computers (date);\n" +
"CREATE INDEX idx_owned_computers_status ON owned_computers (status);\n" +
"CREATE INDEX idx_owned_computers_trade ON owned_computers (trade);\n" +
"CREATE INDEX idx_owned_computers_boxed ON owned_computers (boxed);\n" +
"CREATE INDEX idx_owned_computers_manuals ON owned_computers (manuals);\n" +
"CREATE INDEX idx_owned_computers_cpu1 ON owned_computers (cpu1);\n" +
"CREATE INDEX idx_owned_computers_cpu2 ON owned_computers (cpu2);\n" +
"CREATE INDEX idx_owned_computers_mhz1 ON owned_computers (mhz1);\n" +
"CREATE INDEX idx_owned_computers_mhz2 ON owned_computers (mhz2);\n" +
"CREATE INDEX idx_owned_computers_ram ON owned_computers (ram);\n" +
"CREATE INDEX idx_owned_computers_vram ON owned_computers (vram);\n" +
"CREATE INDEX idx_owned_computers_rigid ON owned_computers (rigid);\n" +
"CREATE INDEX idx_owned_computers_disk1 ON owned_computers (disk1);\n" +
"CREATE INDEX idx_owned_computers_disk2 ON owned_computers (disk2);\n" +
"CREATE INDEX idx_owned_computers_cap1 ON owned_computers (cap1);\n" +
"CREATE INDEX idx_owned_computers_cap2 ON owned_computers (cap2);";
public static readonly string OwnedConsoles =
V3.OwnedConsoles + "\n" +
"CREATE INDEX idx_owned_consoles_db_id ON owned_consoles (db_id);\n" +
"CREATE INDEX idx_owned_consoles_date ON owned_consoles (date);\n" +
"CREATE INDEX idx_owned_consoles_status ON owned_consoles (status);\n" +
"CREATE INDEX idx_owned_consoles_trade ON owned_consoles (trade);\n" +
"CREATE INDEX idx_owned_consoles_boxed ON owned_consoles (boxed);\n" +
"CREATE INDEX idx_owned_consoles_manuals ON owned_consoles (manuals);";
public static readonly string OwnedConsoles = V3.OwnedConsoles + "\n" +
"CREATE INDEX idx_owned_consoles_db_id ON owned_consoles (db_id);\n" +
"CREATE INDEX idx_owned_consoles_date ON owned_consoles (date);\n" +
"CREATE INDEX idx_owned_consoles_status ON owned_consoles (status);\n" +
"CREATE INDEX idx_owned_consoles_trade ON owned_consoles (trade);\n" +
"CREATE INDEX idx_owned_consoles_boxed ON owned_consoles (boxed);\n" +
"CREATE INDEX idx_owned_consoles_manuals ON owned_consoles (manuals);";
public static readonly string Processors = @"CREATE TABLE IF NOT EXISTS `processors` (
`id` int(11) NOT NULL AUTO_INCREMENT,

View File

@@ -68,10 +68,10 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string SoundSynths = V4.SoundSynths;
public static readonly string ComputersForeignKeys =
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_company (company) REFERENCES companies (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_cpu1 (cpu1) REFERENCES processors (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_cpu2 (cpu2) REFERENCES processors (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_gpu (gpu) REFERENCES gpus (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_company (company) REFERENCES companies (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_cpu1 (cpu1) REFERENCES processors (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_cpu2 (cpu2) REFERENCES processors (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_gpu (gpu) REFERENCES gpus (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_sound_synth (sound_synth) REFERENCES sound_synths (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_music_synth (music_synth) REFERENCES music_synths (id);\n" +
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_hdd1 (hdd1) REFERENCES disk_formats (id);\n" +
@@ -81,10 +81,10 @@ namespace Marechai.Database.Schemas.Sql
"ALTER TABLE computers ADD FOREIGN KEY fk_computers_disk2 (disk2) REFERENCES disk_formats (id);";
public static readonly string ConsolesForeignKeys =
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_company (company) REFERENCES companies (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_cpu1 (cpu1) REFERENCES processors (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_cpu2 (cpu2) REFERENCES processors (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_gpu (gpu) REFERENCES gpus (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_company (company) REFERENCES companies (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_cpu1 (cpu1) REFERENCES processors (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_cpu2 (cpu2) REFERENCES processors (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_gpu (gpu) REFERENCES gpus (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_sound_synth (sound_synth) REFERENCES sound_synths (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_music_synth (music_synth) REFERENCES music_synths (id);\n" +
"ALTER TABLE consoles ADD FOREIGN KEY fk_consoles_format (format) REFERENCES disk_formats (id);";

View File

@@ -38,32 +38,31 @@ namespace Marechai.Database.Schemas.Sql
"PRIMARY KEY (`id`)\n" + ");\n" +
"INSERT INTO marechai_db (version) VALUES ('6');";
public static readonly string Companies = "CREATE TABLE `companies` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`name` varchar(128) NOT NULL DEFAULT '',\n" +
"`founded` datetime DEFAULT NULL,\n" +
"`website` varchar(255) DEFAULT NULL,\n" +
"`twitter` varchar(45) DEFAULT NULL,\n" +
"`facebook` varchar(45) DEFAULT NULL,\n" +
"`sold` datetime DEFAULT NULL,\n" +
"`sold_to` int(11) DEFAULT NULL,\n" +
"`address` varchar(80) DEFAULT NULL,\n" +
"`city` varchar(80) DEFAULT NULL,\n" +
"`province` varchar(80) DEFAULT NULL,\n" +
"`postal_code` varchar(25) DEFAULT NULL,\n" +
public static readonly string Companies = "CREATE TABLE `companies` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`name` varchar(128) NOT NULL DEFAULT '',\n" +
"`founded` datetime DEFAULT NULL,\n" +
"`website` varchar(255) DEFAULT NULL,\n" +
"`twitter` varchar(45) DEFAULT NULL,\n" +
"`facebook` varchar(45) DEFAULT NULL,\n" +
"`sold` datetime DEFAULT NULL,\n" +
"`sold_to` int(11) DEFAULT NULL,\n" +
"`address` varchar(80) DEFAULT NULL,\n" +
"`city` varchar(80) DEFAULT NULL,\n" +
"`province` varchar(80) DEFAULT NULL,\n" +
"`postal_code` varchar(25) DEFAULT NULL,\n" +
"`country` smallint(3) UNSIGNED ZEROFILL DEFAULT NULL,\n" +
"PRIMARY KEY (`id`),\n" +
"KEY `idx_companies_name` (`name`),\n" +
"KEY `idx_companies_founded` (`founded`),\n" +
"KEY `idx_companies_website` (`website`),\n" +
"KEY `idx_companies_twitter` (`twitter`),\n" +
"KEY `idx_companies_facebook` (`facebook`),\n" +
"KEY `idx_companies_sold` (`sold`),\n" +
"KEY `idx_companies_sold_to` (`sold_to`),\n" +
"KEY `idx_companies_address` (`address`),\n" +
"KEY `idx_companies_city` (`city`),\n" +
"KEY `idx_companies_province` (`province`),\n" +
"KEY `idx_companies_postal_code` (`postal_code`),\n" +
"PRIMARY KEY (`id`),\n" + "KEY `idx_companies_name` (`name`),\n" +
"KEY `idx_companies_founded` (`founded`),\n" +
"KEY `idx_companies_website` (`website`),\n" +
"KEY `idx_companies_twitter` (`twitter`),\n" +
"KEY `idx_companies_facebook` (`facebook`),\n" +
"KEY `idx_companies_sold` (`sold`),\n" +
"KEY `idx_companies_sold_to` (`sold_to`),\n" +
"KEY `idx_companies_address` (`address`),\n" +
"KEY `idx_companies_city` (`city`),\n" +
"KEY `idx_companies_province` (`province`),\n" +
"KEY `idx_companies_postal_code` (`postal_code`),\n" +
"KEY `idx_companies_country` (`country`));";
public static readonly string Computers = V5.Computers;
@@ -96,73 +95,72 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string ConsolesForeignKeys = V5.ConsolesForeignKeys;
public static readonly string Iso3166Numeric = "CREATE TABLE `iso3166_1_numeric` (\n" +
public static readonly string Iso3166Numeric = "CREATE TABLE `iso3166_1_numeric` (\n" +
"`id` SMALLINT(3) UNSIGNED ZEROFILL NOT NULL,\n" +
"`name` VARCHAR(64) NOT NULL,\n" +
"PRIMARY KEY (`id`),\n" +
"`name` VARCHAR(64) NOT NULL,\n" + "PRIMARY KEY (`id`),\n" +
"INDEX `idx_name` (`name` ASC));";
public static readonly string Iso3166NumericValues =
"INSERT INTO `iso3166_1_numeric` VALUES (004,'Afghanistan'),(248,'Åland Islands'),(008,'Albania')," +
"(012,'Algeria'),(016,'American Samoa'),(020,'Andorra'),(024,'Angola'),(660,'Anguilla'),(010,'Antarctica')," +
"(028,'Antigua and Barbuda'),(032,'Argentina'),(051,'Armenia'),(533,'Aruba'),(036,'Australia')," +
"(040,'Austria'),(031,'Azerbaijan'),(044,'Bahamas'),(048,'Bahrain'),(050,'Bangladesh'),(052,'Barbados')," +
"(112,'Belarus'),(056,'Belgium'),(084,'Belize'),(204,'Benin'),(060,'Bermuda'),(064,'Bhutan')," +
"(862,'Bolivarian Republic of Venezuela'),(535,'Bonaire, Sint Eustatius and Saba')," +
"(070,'Bosnia and Herzegovina'),(072,'Botswana'),(074,'Bouvet Island'),(076,'Brazil')," +
"(080,'British Antarctic Territory'),(086,'British Indian Ocean Territory'),(092,'British Virgin Islands')," +
"(096,'Brunei Darussalam'),(100,'Bulgaria'),(854,'Burkina Faso'),(108,'Burundi'),(132,'Cabo Verde')," +
"(116,'Cambodia'),(120,'Cameroon'),(124,'Canada'),(128,'Canton and Enderbury Islands')," +
"(136,'Cayman Islands'),(140,'Central African Republic'),(148,'Chad'),(830,'Channel Islands'),(152,'Chile')," +
"(156,'China'),(162,'Christmas Island'),(166,'Cocos (Keeling) Islands'),(170,'Colombia'),(174,'Comoros')," +
"(178,'Congo'),(184,'Cook Islands'),(188,'Costa Rica'),(384,'Côte d\\'Ivoire'),(191,'Croatia'),(192,'Cuba')," +
"(531,'Curaçao'),(196,'Cyprus'),(203,'Czechia'),(200,'Czechoslovakia')," +
"(408,'Democratic People\\'s Republic of Korea'),(180,'Democratic Republic of the Congo')," +
"(720,'Democratic Yemen'),(208,'Denmark'),(262,'Djibouti'),(212,'Dominica'),(214,'Dominican Republic')," +
"(216,'Dronning Maud Land'),(218,'Ecuador'),(818,'Egypt'),(222,'El Salvador'),(226,'Equatorial Guinea')," +
"(232,'Eritrea'),(233,'Estonia'),(230,'Ethiopia'),(231,'Ethiopia'),(238,'Falkland Islands (Malvinas)')," +
"(234,'Faroe Islands'),(280,'Federal Republic of Germany'),(583,'Federated States of Micronesia')," +
"(242,'Fiji'),(246,'Finland'),(250,'France'),(249,'France, Metropolitan'),(254,'French Guiana')," +
"(258,'French Polynesia'),(260,'French Southern Territories'),(266,'Gabon'),(270,'Gambia')," +
"(274,'Gaza Strip (Palestine)'),(268,'Georgia'),(278,'German Democratic Republic'),(276,'Germany')," +
"(288,'Ghana'),(292,'Gibraltar'),(300,'Greece'),(304,'Greenland'),(308,'Grenada'),(312,'Guadeloupe')," +
"(316,'Guam'),(320,'Guatemala'),(831,'Guernsey'),(324,'Guinea'),(624,'Guinea-Bissau'),(328,'Guyana')," +
"(332,'Haiti'),(334,'Heard Island and McDonald Islands'),(336,'Holy See'),(340,'Honduras')," +
"(344,'Hong Kong'),(348,'Hungary'),(352,'Iceland'),(356,'India'),(360,'Indonesia'),(368,'Iraq')," +
"(372,'Ireland'),(364,'Islamic Republic of Iran'),(833,'Isle of Man'),(376,'Israel'),(380,'Italy')," +
"(388,'Jamaica'),(392,'Japan'),(832,'Jersey'),(396,'Johnston Island'),(400,'Jordan'),(398,'Kazakhstan')," +
"INSERT INTO `iso3166_1_numeric` VALUES (004,'Afghanistan'),(248,'Åland Islands'),(008,'Albania')," +
"(012,'Algeria'),(016,'American Samoa'),(020,'Andorra'),(024,'Angola'),(660,'Anguilla'),(010,'Antarctica')," +
"(028,'Antigua and Barbuda'),(032,'Argentina'),(051,'Armenia'),(533,'Aruba'),(036,'Australia')," +
"(040,'Austria'),(031,'Azerbaijan'),(044,'Bahamas'),(048,'Bahrain'),(050,'Bangladesh'),(052,'Barbados')," +
"(112,'Belarus'),(056,'Belgium'),(084,'Belize'),(204,'Benin'),(060,'Bermuda'),(064,'Bhutan')," +
"(862,'Bolivarian Republic of Venezuela'),(535,'Bonaire, Sint Eustatius and Saba')," +
"(070,'Bosnia and Herzegovina'),(072,'Botswana'),(074,'Bouvet Island'),(076,'Brazil')," +
"(080,'British Antarctic Territory'),(086,'British Indian Ocean Territory'),(092,'British Virgin Islands')," +
"(096,'Brunei Darussalam'),(100,'Bulgaria'),(854,'Burkina Faso'),(108,'Burundi'),(132,'Cabo Verde')," +
"(116,'Cambodia'),(120,'Cameroon'),(124,'Canada'),(128,'Canton and Enderbury Islands')," +
"(136,'Cayman Islands'),(140,'Central African Republic'),(148,'Chad'),(830,'Channel Islands'),(152,'Chile')," +
"(156,'China'),(162,'Christmas Island'),(166,'Cocos (Keeling) Islands'),(170,'Colombia'),(174,'Comoros')," +
"(178,'Congo'),(184,'Cook Islands'),(188,'Costa Rica'),(384,'Côte d\\'Ivoire'),(191,'Croatia'),(192,'Cuba')," +
"(531,'Curaçao'),(196,'Cyprus'),(203,'Czechia'),(200,'Czechoslovakia')," +
"(408,'Democratic People\\'s Republic of Korea'),(180,'Democratic Republic of the Congo')," +
"(720,'Democratic Yemen'),(208,'Denmark'),(262,'Djibouti'),(212,'Dominica'),(214,'Dominican Republic')," +
"(216,'Dronning Maud Land'),(218,'Ecuador'),(818,'Egypt'),(222,'El Salvador'),(226,'Equatorial Guinea')," +
"(232,'Eritrea'),(233,'Estonia'),(230,'Ethiopia'),(231,'Ethiopia'),(238,'Falkland Islands (Malvinas)')," +
"(234,'Faroe Islands'),(280,'Federal Republic of Germany'),(583,'Federated States of Micronesia')," +
"(242,'Fiji'),(246,'Finland'),(250,'France'),(249,'France, Metropolitan'),(254,'French Guiana')," +
"(258,'French Polynesia'),(260,'French Southern Territories'),(266,'Gabon'),(270,'Gambia')," +
"(274,'Gaza Strip (Palestine)'),(268,'Georgia'),(278,'German Democratic Republic'),(276,'Germany')," +
"(288,'Ghana'),(292,'Gibraltar'),(300,'Greece'),(304,'Greenland'),(308,'Grenada'),(312,'Guadeloupe')," +
"(316,'Guam'),(320,'Guatemala'),(831,'Guernsey'),(324,'Guinea'),(624,'Guinea-Bissau'),(328,'Guyana')," +
"(332,'Haiti'),(334,'Heard Island and McDonald Islands'),(336,'Holy See'),(340,'Honduras')," +
"(344,'Hong Kong'),(348,'Hungary'),(352,'Iceland'),(356,'India'),(360,'Indonesia'),(368,'Iraq')," +
"(372,'Ireland'),(364,'Islamic Republic of Iran'),(833,'Isle of Man'),(376,'Israel'),(380,'Italy')," +
"(388,'Jamaica'),(392,'Japan'),(832,'Jersey'),(396,'Johnston Island'),(400,'Jordan'),(398,'Kazakhstan')," +
"(404,'Kenya'),(296,'Kiribati'),(414,'Kuwait'),(417,'Kyrgyzstan'),(418,'Lao People\\'s Democratic Republic')," +
"(428,'Latvia'),(422,'Lebanon'),(426,'Lesotho'),(430,'Liberia'),(434,'Libya'),(438,'Liechtenstein')," +
"(440,'Lithuania'),(442,'Luxembourg'),(446,'Macao'),(450,'Madagascar'),(454,'Malawi'),(458,'Malaysia')," +
"(462,'Maldives'),(466,'Mali'),(470,'Malta'),(584,'Marshall Islands'),(474,'Martinique'),(478,'Mauritania')," +
"(480,'Mauritius'),(175,'Mayotte'),(484,'Mexico'),(488,'Midway Islands'),(492,'Monaco'),(496,'Mongolia')," +
"(499,'Montenegro'),(500,'Montserrat'),(504,'Morocco'),(508,'Mozambique'),(104,'Myanmar'),(516,'Namibia')," +
"(520,'Nauru'),(524,'Nepal'),(528,'Netherlands'),(530,'Netherlands Antilles'),(532,'Netherlands Antilles')," +
"(536,'Neutral Zone'),(540,'New Caledonia'),(554,'New Zealand'),(558,'Nicaragua'),(562,'Niger')," +
"(566,'Nigeria'),(570,'Niue'),(574,'Norfolk Island'),(580,'Northern Mariana Islands'),(578,'Norway')," +
"(512,'Oman'),(586,'Pakistan'),(585,'Palau'),(590,'Panama'),(591,'Panama'),(594,'Panama Canal Zone')," +
"(598,'Papua New Guinea'),(600,'Paraguay'),(604,'Peru'),(608,'Philippines'),(612,'Pitcairn')," +
"(068,'Plurinational State of Bolivia'),(616,'Poland'),(620,'Portugal'),(630,'Puerto Rico'),(634,'Qatar')," +
"(410,'Republic of Korea'),(498,'Republic of Moldova'),(714,'Republic of Viet-Nam'),(638,'Réunion')," +
"(642,'Romania'),(643,'Russian Federation'),(646,'Rwanda'),(650,'Ryukyu Islands'),(652,'Saint Barthélemy')," +
"(654,'Saint Helena, Ascension and Tristan da Cunha'),(659,'Saint Kitts and Nevis')," +
"(658,'Saint Kitts-Nevis-Anguilla'),(662,'Saint Lucia'),(663,'Saint Martin')," +
"(666,'Saint Pierre and Miquelon'),(670,'Saint Vincent and the Grenadines'),(882,'Samoa')," +
"(674,'San Marino'),(678,'Sao Tome and Principe'),(682,'Saudi Arabia'),(686,'Senegal'),(688,'Serbia')," +
"(891,'Serbia and Montenegro'),(690,'Seychelles'),(694,'Sierra Leone'),(698,'Sikkim'),(702,'Singapore')," +
"(534,'Sint Marteen'),(703,'Slovakia'),(705,'Slovenia'),(890,'Socialist Federal Republic of Yugoslavia')," +
"(090,'Solomon Islands'),(706,'Somalia'),(710,'South Africa')," +
"(239,'South Georgia and the South Sandwich Islands'),(728,'South Sudan'),(724,'Spain'),(144,'Sri Lanka')," +
"(275,'State of Palestine'),(729,'Sudan'),(736,'Sudan'),(740,'Suriname'),(744,'Svalbard and Jan Mayen')," +
"(748,'Swaziland'),(752,'Sweden'),(756,'Switzerland'),(760,'Syrian Arab Republic')," +
"(158,'Taiwan, Province of China'),(762,'Tajikistan'),(764,'Thailand')," +
"(807,'The former Yugoslav Republic of Macedonia'),(626,'Timor-Leste'),(768,'Togo'),(772,'Tokelau')," +
"(776,'Tonga'),(780,'Trinidad and Tobago'),(582,'Trust Territory of the Pacific Islands'),(788,'Tunisia')," +
"(792,'Turkey'),(795,'Turkmenistan'),(796,'Turks and Caicos Islands'),(798,'Tuvalu')," +
"(849,'U.S. Miscellaneous Pacific Islands'),(800,'Uganda'),(804,'Ukraine'),(784,'United Arab Emirates')," +
"(826,'United Kingdom'),(834,'United Republic of Tanzania'),(581,'United States Minor Outlying Islands')," +
"(840,'United States of America'),(858,'Uruguay'),(810,'USSR'),(860,'Uzbekistan'),(548,'Vanuatu')," +
"(704,'Viet-Nam'),(850,'Virgin Islands, U.S.'),(872,'Wake Island'),(876,'Wallis and Futuna')," +
"(428,'Latvia'),(422,'Lebanon'),(426,'Lesotho'),(430,'Liberia'),(434,'Libya'),(438,'Liechtenstein')," +
"(440,'Lithuania'),(442,'Luxembourg'),(446,'Macao'),(450,'Madagascar'),(454,'Malawi'),(458,'Malaysia')," +
"(462,'Maldives'),(466,'Mali'),(470,'Malta'),(584,'Marshall Islands'),(474,'Martinique'),(478,'Mauritania')," +
"(480,'Mauritius'),(175,'Mayotte'),(484,'Mexico'),(488,'Midway Islands'),(492,'Monaco'),(496,'Mongolia')," +
"(499,'Montenegro'),(500,'Montserrat'),(504,'Morocco'),(508,'Mozambique'),(104,'Myanmar'),(516,'Namibia')," +
"(520,'Nauru'),(524,'Nepal'),(528,'Netherlands'),(530,'Netherlands Antilles'),(532,'Netherlands Antilles')," +
"(536,'Neutral Zone'),(540,'New Caledonia'),(554,'New Zealand'),(558,'Nicaragua'),(562,'Niger')," +
"(566,'Nigeria'),(570,'Niue'),(574,'Norfolk Island'),(580,'Northern Mariana Islands'),(578,'Norway')," +
"(512,'Oman'),(586,'Pakistan'),(585,'Palau'),(590,'Panama'),(591,'Panama'),(594,'Panama Canal Zone')," +
"(598,'Papua New Guinea'),(600,'Paraguay'),(604,'Peru'),(608,'Philippines'),(612,'Pitcairn')," +
"(068,'Plurinational State of Bolivia'),(616,'Poland'),(620,'Portugal'),(630,'Puerto Rico'),(634,'Qatar')," +
"(410,'Republic of Korea'),(498,'Republic of Moldova'),(714,'Republic of Viet-Nam'),(638,'Réunion')," +
"(642,'Romania'),(643,'Russian Federation'),(646,'Rwanda'),(650,'Ryukyu Islands'),(652,'Saint Barthélemy')," +
"(654,'Saint Helena, Ascension and Tristan da Cunha'),(659,'Saint Kitts and Nevis')," +
"(658,'Saint Kitts-Nevis-Anguilla'),(662,'Saint Lucia'),(663,'Saint Martin')," +
"(666,'Saint Pierre and Miquelon'),(670,'Saint Vincent and the Grenadines'),(882,'Samoa')," +
"(674,'San Marino'),(678,'Sao Tome and Principe'),(682,'Saudi Arabia'),(686,'Senegal'),(688,'Serbia')," +
"(891,'Serbia and Montenegro'),(690,'Seychelles'),(694,'Sierra Leone'),(698,'Sikkim'),(702,'Singapore')," +
"(534,'Sint Marteen'),(703,'Slovakia'),(705,'Slovenia'),(890,'Socialist Federal Republic of Yugoslavia')," +
"(090,'Solomon Islands'),(706,'Somalia'),(710,'South Africa')," +
"(239,'South Georgia and the South Sandwich Islands'),(728,'South Sudan'),(724,'Spain'),(144,'Sri Lanka')," +
"(275,'State of Palestine'),(729,'Sudan'),(736,'Sudan'),(740,'Suriname'),(744,'Svalbard and Jan Mayen')," +
"(748,'Swaziland'),(752,'Sweden'),(756,'Switzerland'),(760,'Syrian Arab Republic')," +
"(158,'Taiwan, Province of China'),(762,'Tajikistan'),(764,'Thailand')," +
"(807,'The former Yugoslav Republic of Macedonia'),(626,'Timor-Leste'),(768,'Togo'),(772,'Tokelau')," +
"(776,'Tonga'),(780,'Trinidad and Tobago'),(582,'Trust Territory of the Pacific Islands'),(788,'Tunisia')," +
"(792,'Turkey'),(795,'Turkmenistan'),(796,'Turks and Caicos Islands'),(798,'Tuvalu')," +
"(849,'U.S. Miscellaneous Pacific Islands'),(800,'Uganda'),(804,'Ukraine'),(784,'United Arab Emirates')," +
"(826,'United Kingdom'),(834,'United Republic of Tanzania'),(581,'United States Minor Outlying Islands')," +
"(840,'United States of America'),(858,'Uruguay'),(810,'USSR'),(860,'Uzbekistan'),(548,'Vanuatu')," +
"(704,'Viet-Nam'),(850,'Virgin Islands, U.S.'),(872,'Wake Island'),(876,'Wallis and Futuna')," +
"(732,'Western Sahara'),(887,'Yemen'),(886,'Yemen Arab Republic'),(894,'Zambia'),(716,'Zimbabwe');";
public static readonly string CompaniesForeignKeys =

View File

@@ -38,34 +38,33 @@ namespace Marechai.Database.Schemas.Sql
"PRIMARY KEY (`id`)\n" + ");\n" +
"INSERT INTO marechai_db (version) VALUES ('7');";
public static readonly string Companies = "CREATE TABLE `companies` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`name` varchar(128) NOT NULL DEFAULT '',\n" +
"`founded` datetime DEFAULT NULL,\n" +
"`website` varchar(255) DEFAULT NULL,\n" +
"`twitter` varchar(45) DEFAULT NULL,\n" +
"`facebook` varchar(45) DEFAULT NULL,\n" +
"`sold` datetime DEFAULT NULL,\n" +
"`sold_to` int(11) DEFAULT NULL,\n" +
"`address` varchar(80) DEFAULT NULL,\n" +
"`city` varchar(80) DEFAULT NULL,\n" +
"`province` varchar(80) DEFAULT NULL,\n" +
"`postal_code` varchar(25) DEFAULT NULL,\n" +
public static readonly string Companies = "CREATE TABLE `companies` (\n" +
"`id` int(11) NOT NULL AUTO_INCREMENT,\n" +
"`name` varchar(128) NOT NULL DEFAULT '',\n" +
"`founded` datetime DEFAULT NULL,\n" +
"`website` varchar(255) DEFAULT NULL,\n" +
"`twitter` varchar(45) DEFAULT NULL,\n" +
"`facebook` varchar(45) DEFAULT NULL,\n" +
"`sold` datetime DEFAULT NULL,\n" +
"`sold_to` int(11) DEFAULT NULL,\n" +
"`address` varchar(80) DEFAULT NULL,\n" +
"`city` varchar(80) DEFAULT NULL,\n" +
"`province` varchar(80) DEFAULT NULL,\n" +
"`postal_code` varchar(25) DEFAULT NULL,\n" +
"`country` smallint(3) UNSIGNED ZEROFILL DEFAULT NULL,\n" +
"`status` int NOT NULL,\n" +
"PRIMARY KEY (`id`),\n" +
"KEY `idx_companies_name` (`name`),\n" +
"KEY `idx_companies_founded` (`founded`),\n" +
"KEY `idx_companies_website` (`website`),\n" +
"KEY `idx_companies_twitter` (`twitter`),\n" +
"KEY `idx_companies_facebook` (`facebook`),\n" +
"KEY `idx_companies_sold` (`sold`),\n" +
"KEY `idx_companies_sold_to` (`sold_to`),\n" +
"KEY `idx_companies_address` (`address`),\n" +
"KEY `idx_companies_city` (`city`),\n" +
"KEY `idx_companies_province` (`province`),\n" +
"KEY `idx_companies_postal_code` (`postal_code`),\n" +
"KEY `idx_companies_status` (`status`),\n" +
"`status` int NOT NULL,\n" + "PRIMARY KEY (`id`),\n" +
"KEY `idx_companies_name` (`name`),\n" +
"KEY `idx_companies_founded` (`founded`),\n" +
"KEY `idx_companies_website` (`website`),\n" +
"KEY `idx_companies_twitter` (`twitter`),\n" +
"KEY `idx_companies_facebook` (`facebook`),\n" +
"KEY `idx_companies_sold` (`sold`),\n" +
"KEY `idx_companies_sold_to` (`sold_to`),\n" +
"KEY `idx_companies_address` (`address`),\n" +
"KEY `idx_companies_city` (`city`),\n" +
"KEY `idx_companies_province` (`province`),\n" +
"KEY `idx_companies_postal_code` (`postal_code`),\n" +
"KEY `idx_companies_status` (`status`),\n" +
"KEY `idx_companies_country` (`country`));";
public static readonly string Computers = V6.Computers;

View File

@@ -76,17 +76,16 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string CompaniesForeignKeys = V7.CompaniesForeignKeys;
public static readonly string CompanyLogos = "CREATE TABLE IF NOT EXISTS `company_logos` (\n" +
"`id` INT NOT NULL AUTO_INCREMENT,\n" +
"`company_id` INT(11) NOT NULL,\n" +
"`year` INT(4) DEFAULT NULL,\n" +
"`logo_guid` CHAR(36) NOT NULL,\n" +
public static readonly string CompanyLogos = "CREATE TABLE IF NOT EXISTS `company_logos` (\n" +
"`id` INT NOT NULL AUTO_INCREMENT,\n" +
"`company_id` INT(11) NOT NULL,\n" +
"`year` INT(4) DEFAULT NULL,\n" +
"`logo_guid` CHAR(36) NOT NULL,\n" +
"PRIMARY KEY (`id`, `company_id`, `logo_guid`),\n" +
"UNIQUE INDEX `idx_id` (`id` ASC),\n" +
"INDEX `idx_company_id` (`company_id` ASC),\n" +
"INDEX `idx_guid` (`logo_guid` ASC),\n" +
"CONSTRAINT `fk_company_logos_company1`\n" +
"FOREIGN KEY (`company_id`)\n" +
"REFERENCES `companies` (`id`))";
"UNIQUE INDEX `idx_id` (`id` ASC),\n" +
"INDEX `idx_company_id` (`company_id` ASC),\n" +
"INDEX `idx_guid` (`logo_guid` ASC),\n" +
"CONSTRAINT `fk_company_logos_company1`\n" +
"FOREIGN KEY (`company_id`)\n" + "REFERENCES `companies` (`id`))";
}
}

View File

@@ -78,15 +78,13 @@ namespace Marechai.Database.Schemas.Sql
public static readonly string CompanyLogos = V8.CompanyLogos;
public static readonly string CompanyDescriptions =
"CREATE TABLE `company_descriptions` (\n" +
"`id` INT NOT NULL AUTO_INCREMENT,\n" +
"`company_id` INT NOT NULL,\n" +
"`text` text,\n" +
"PRIMARY KEY (`id`),\n" +
"INDEX `idx_company_id` (`company_id` ASC),\n" +
"FULLTEXT KEY `idx_text` (`text`),\n" +
"CONSTRAINT `fk_company_id` FOREIGN KEY (`id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE\n" +
")";
public static readonly string CompanyDescriptions = "CREATE TABLE `company_descriptions` (\n" +
"`id` INT NOT NULL AUTO_INCREMENT,\n" +
"`company_id` INT NOT NULL,\n" + "`text` text,\n" +
"PRIMARY KEY (`id`),\n" +
"INDEX `idx_company_id` (`company_id` ASC),\n" +
"FULLTEXT KEY `idx_text` (`text`),\n" +
"CONSTRAINT `fk_company_id` FOREIGN KEY (`id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE\n" +
")";
}
}