diff --git a/Marechai.Database/Enums.cs b/Marechai.Database/Enums.cs
index a1371050..07117023 100644
--- a/Marechai.Database/Enums.cs
+++ b/Marechai.Database/Enums.cs
@@ -29,6 +29,7 @@
*******************************************************************************/
using System.ComponentModel.DataAnnotations;
+
// ReSharper disable UnusedMember.Global
// ReSharper disable InconsistentNaming
@@ -36,27 +37,18 @@ namespace Marechai.Database
{
public enum NewsType
{
- NewComputerInDb = 1,
- NewConsoleInDb = 2,
- NewComputerInCollection = 3,
- NewConsoleInCollection = 4,
- UpdatedComputerInDb = 5,
- UpdatedConsoleInDb = 6,
- UpdatedComputerInCollection = 7,
- UpdatedConsoleInCollection = 8,
- NewMoneyDonation = 9
+ NewComputerInDb = 1, NewConsoleInDb = 2, NewComputerInCollection = 3,
+ NewConsoleInCollection = 4, UpdatedComputerInDb = 5, UpdatedConsoleInDb = 6,
+ UpdatedComputerInCollection = 7, UpdatedConsoleInCollection = 8, NewMoneyDonation = 9
}
public enum StatusType
{
[Display(Name = "Unknown")]
- Unknown = 0,
- [Display(Name = "Tested good")]
- TestedGood = 1,
- [Display(Name = "Not tested")]
- NotTested = 2,
- [Display(Name = "Tested bad")]
- TestedBad = 3
+ Unknown = 0, [Display(Name = "Tested good")]
+ TestedGood = 1, [Display(Name = "Not tested")]
+ NotTested = 2, [Display(Name = "Tested bad")]
+ TestedBad = 3
}
public enum CompanyStatus
@@ -243,22 +235,15 @@ namespace Marechai.Database
/// Pioneer LaserDisc
LD = 21,
/// Pioneer LaserDisc data
- LDROM = 22,
- LDROM2 = 23,
- LVROM = 24,
- MegaLD = 254,
+ LDROM = 22, LDROM2 = 23, LVROM = 24, MegaLD = 254,
/// Sony Hi-MD
HiMD = 26,
/// Sony MiniDisc
- MD = 27,
- MDData = 28,
- MDData2 = 29,
+ MD = 27, MDData = 28, MDData2 = 29,
/// 5.25", Phase-Change, 1834348 sectors, 8192 bytes/sector, Ultra Density Optical, ECMA-350, ISO 17345
UDO = 30,
/// 5.25", Phase-Change, 3669724 sectors, 8192 bytes/sector, Ultra Density Optical 2, ECMA-380, ISO 11976
- UDO2 = 31,
- PlayStationMemoryCard = 32,
- PlayStationMemoryCard2 = 33,
+ UDO2 = 31, PlayStationMemoryCard = 32, PlayStationMemoryCard2 = 33,
/// Sony PlayStation game CD
PS1CD = 34,
/// Sony PlayStation 2 game CD
@@ -286,8 +271,7 @@ namespace Marechai.Database
/// Sega Saturn disc
SATURNCD = 46,
/// Sega/Yamaha Gigabyte Disc
- GDROM = 47,
- SegaCard = 48,
+ GDROM = 47, SegaCard = 48,
/// PC-Engine / TurboGrafx cartridge
HuCard = 49,
/// PC-Engine / TurboGrafx CD
@@ -307,383 +291,212 @@ namespace Marechai.Database
/// 3.5" floppy
Microfloppy = 57,
/// 5.25", DS, ?D, ?? tracks, ?? spt, 512 bytes/sector, GCR, opposite side heads, aka Twiggy
- AppleFileWare = 58,
- Bernoulli = 59,
- Bernoulli2 = 60,
- Ditto = 61,
- DittoMax = 62,
- Jaz = 63,
- Jaz2 = 64,
- PocketZip = 65,
- REV120 = 66,
- REV35 = 67,
- REV70 = 68,
- ZIP100 = 69,
- ZIP250 = 70,
- ZIP750 = 71,
- CompactCassette = 72,
- Data8 = 73,
- MiniDV = 74,
- CFast = 75,
- CompactFlash = 76,
- CompactFlashType2 = 77,
- EZ135 = 78,
- EZ230 = 79,
- Quest = 80,
- SparQ = 81,
- SQ100 = 82,
- SQ200 = 83,
- SQ300 = 84,
- SQ310 = 85,
- SQ327 = 86,
- SQ400 = 87,
- SQ800 = 88,
- SQ1500 = 89,
- SQ2000 = 90,
- SyJet = 91,
- FamicomGamePak = 92,
- GameBoyAdvanceGamePak = 93,
- GameBoyGamePak = 94,
- GOD = 95,
- N64DD = 96,
- N64GamePak = 97,
- NESGamePak = 98,
- Nintendo3DSGameCard = 99,
- NintendoDiskCard = 100,
- NintendoDSGameCard = 101,
- NintendoDSiGameCard = 102,
- SNESGamePak = 103,
- SNESGamePakUS = 104,
- WOD = 105,
- WUOD = 106,
- SwitchGameCard = 107,
- MemoryStick = 108,
- MemoryStickDuo = 109,
- MemoryStickMicro = 110,
- MemoryStickPro = 111,
- MemoryStickProDuo = 112,
- microSD = 113,
- miniSD = 114,
- SecureDigital = 115,
- MMC = 116,
- MMCmicro = 117,
- RSMMC = 118,
- MMCplus = 118,
- MMCmobile = 119,
- eMMC = 120,
- MO120 = 121,
- MO90 = 122,
- MO300 = 123,
- MO356 = 124,
- CompactFloppy = 125,
- DemiDiskette = 126,
+ AppleFileWare = 58, Bernoulli = 59, Bernoulli2 = 60, Ditto = 61,
+ DittoMax = 62, Jaz = 63, Jaz2 = 64,
+ PocketZip = 65, REV120 = 66, REV35 = 67,
+ REV70 = 68, ZIP100 = 69, ZIP250 = 70,
+ ZIP750 = 71, CompactCassette = 72, Data8 = 73,
+ MiniDV = 74, CFast = 75, CompactFlash = 76,
+ CompactFlashType2 = 77, EZ135 = 78, EZ230 = 79,
+ Quest = 80, SparQ = 81, SQ100 = 82,
+ SQ200 = 83, SQ300 = 84, SQ310 = 85,
+ SQ327 = 86, SQ400 = 87, SQ800 = 88,
+ SQ1500 = 89, SQ2000 = 90, SyJet = 91,
+ FamicomGamePak = 92, GameBoyAdvanceGamePak = 93, GameBoyGamePak = 94,
+ GOD = 95, N64DD = 96, N64GamePak = 97,
+ NESGamePak = 98, Nintendo3DSGameCard = 99, NintendoDiskCard = 100,
+ NintendoDSGameCard = 101, NintendoDSiGameCard = 102, SNESGamePak = 103,
+ SNESGamePakUS = 104, WOD = 105, WUOD = 106,
+ SwitchGameCard = 107, MemoryStick = 108, MemoryStickDuo = 109,
+ MemoryStickMicro = 110, MemoryStickPro = 111, MemoryStickProDuo = 112,
+ microSD = 113, miniSD = 114, SecureDigital = 115,
+ MMC = 116, MMCmicro = 117, RSMMC = 118,
+ MMCplus = 118, MMCmobile = 119, eMMC = 120,
+ MO120 = 121, MO90 = 122, MO300 = 123,
+ MO356 = 124, CompactFloppy = 125, DemiDiskette = 126,
/// 3.5", 652 tracks, 2 sides, 512 bytes/sector, Floptical, ECMA-207, ISO 14169
- Floptical = 127,
- HiFD = 128,
- QuickDisk = 129,
- UHD144 = 130,
- VideoFloppy = 131,
- Wafer = 132,
- ZXMicrodrive = 133,
- BeeCard = 134,
- Borsu = 135,
- DataStore = 136,
- MiniCard = 137,
- Orb = 138,
- Orb5 = 139,
- SmartMedia = 140,
- xD = 141,
- XQD = 142,
- DataPlay = 143,
- LS120 = 144,
- LS240 = 145,
- FD32MB = 146,
- RDX = 147,
- PunchedCard = 148
+ Floptical = 127, HiFD = 128, QuickDisk = 129, UHD144 = 130,
+ VideoFloppy = 131, Wafer = 132, ZXMicrodrive = 133,
+ BeeCard = 134, Borsu = 135, DataStore = 136,
+ MiniCard = 137, Orb = 138, Orb5 = 139,
+ SmartMedia = 140, xD = 141, XQD = 142,
+ DataPlay = 143, LS120 = 144, LS240 = 145,
+ FD32MB = 146, RDX = 147, PunchedCard = 148
}
public enum StorageInterface
{
- Unknown = 0,
- ACSI = 1,
- ATA = 2,
- XTA = 3,
- ESDI = 4,
- SCSI = 5,
- USB = 6,
- FireWire = 7,
- SASI = 8,
- ST506 = 9,
- IPI = 10,
- SMD = 11,
- SATA = 12,
- SSA = 13,
- DSSI = 14,
- HIPPI = 15,
- SAS = 16,
- FC = 17,
- PCIe = 18,
- M2 = 19,
- SataExpress = 20
+ Unknown = 0, ACSI = 1, ATA = 2,
+ XTA = 3, ESDI = 4, SCSI = 5,
+ USB = 6, FireWire = 7, SASI = 8,
+ ST506 = 9, IPI = 10, SMD = 11,
+ SATA = 12, SSA = 13, DSSI = 14,
+ HIPPI = 15, SAS = 16, FC = 17,
+ PCIe = 18, M2 = 19, SataExpress = 20
}
public enum ColorSpace : ushort
{
[Display(Name = "sRGB")]
- Srgb = 1,
- [Display(Name = "Adobe RGB")]
- AdobeRgb = 2,
- [Display(Name = "Wide Gamut RGB")]
- WideGamutRgb = 4093,
- [Display(Name = "ICC Profile")]
- IccProfile = 65534,
- [Display(Name = "Uncalibrated")]
+ Srgb = 1, [Display(Name = "Adobe RGB")]
+ AdobeRgb = 2, [Display(Name = "Wide Gamut RGB")]
+ WideGamutRgb = 4093, [Display(Name = "ICC Profile")]
+ IccProfile = 65534, [Display(Name = "Uncalibrated")]
Uncalibreated = 65535
}
public enum Contrast : ushort
{
- Normal = 0,
- Low = 1,
- Hig = 2
+ Normal = 0, Low = 1, Hig = 2
}
public enum ExposureMode : ushort
{
- Auto = 0,
- Manual = 1,
- [Display(Name = "Auto bracket")]
+ Auto = 0, Manual = 1, [Display(Name = "Auto bracket")]
AutoBracket = 2
}
public enum ExposureProgram : ushort
{
[Display(Name = "Not Defined")]
- Undefined = 0,
- [Display(Name = "Manual")]
- Manual = 1,
- [Display(Name = "Program AE")]
- ProgramAe = 2,
- [Display(Name = "Aperture-priority AE")]
- ApAe = 3,
- [Display(Name = "Shutter speed priority AE")]
- ShutterAe = 4,
- [Display(Name = "Creative (Slow speed)")]
- Creative = 5,
- [Display(Name = "Action (High speed)")]
- Action = 6,
- [Display(Name = "Portrait")]
- Portrait = 7,
- [Display(Name = "Landscape")]
- Landscape = 8,
- [Display(Name = "Bulb")]
+ Undefined = 0, [Display(Name = "Manual")]
+ Manual = 1, [Display(Name = "Program AE")]
+ ProgramAe = 2, [Display(Name = "Aperture-priority AE")]
+ ApAe = 3, [Display(Name = "Shutter speed priority AE")]
+ ShutterAe = 4, [Display(Name = "Creative (Slow speed)")]
+ Creative = 5, [Display(Name = "Action (High speed)")]
+ Action = 6, [Display(Name = "Portrait")]
+ Portrait = 7, [Display(Name = "Landscape")]
+ Landscape = 8, [Display(Name = "Bulb")]
Bulb = 9
}
public enum Flash : ushort
{
[Display(Name = "No Flash")]
- None = 0,
- [Display(Name = "Fired")]
- Fired = 1,
- [Display(Name = "Fired, Return not detected")]
- FiredNoReturn = 5,
- [Display(Name = "Fired, Return detected")]
- FiredReturn = 7,
- [Display(Name = "On, Did not fire")]
- OnDidNotFire = 8,
- [Display(Name = "On, Fired")]
- OnFired = 9,
- [Display(Name = "On, Return not detected")]
- OnNoReturn = 13,
- [Display(Name = "On, Return detected")]
- OnReturn = 15,
- [Display(Name = "Off, Did not fire")]
- OffDidNotFire = 16,
- [Display(Name = "Off, Did not fire, Return not detected")]
- OffDidNotFireNoReturn = 20,
- [Display(Name = "Auto, Did not fire")]
- AutoDidNotFire = 24,
- [Display(Name = "Auto, Fired")]
- AutoFired = 25,
- [Display(Name = "Auto, Fired, Return not detected")]
- AutoFiredNoReturn = 29,
- [Display(Name = "Auto, Fired, Return detected")]
- AutoFiredReturn = 31,
- [Display(Name = "No flash function")]
- NoFlash = 32,
- [Display(Name = "Off, No flash function")]
- OffNoFlash = 48,
- [Display(Name = "Fired, Red-eye reduction")]
- FiredRedEye = 65,
- [Display(Name = "Fired, Red-eye reduction, Return not detected")]
- FiredRedEyeNoReturn = 69,
- [Display(Name = "Fired, Red-eye reduction, Return detected")]
- FiredRedEyeReturn = 71,
- [Display(Name = "On, Red-eye reduction")]
- OnRedEye = 73,
- [Display(Name = "On, Red-eye reduction, Return not detected")]
- OnRedEyeNoReturn = 77,
- [Display(Name = "On, Red-eye reduction, Return detected")]
- OnRedEyeReturn = 79,
- [Display(Name = "Off, Red-eye reduction")]
- OffRedEye = 80,
- [Display(Name = "Auto, Did not fire, Red-eye reduction")]
- AutoNotFireRedEye = 88,
- [Display(Name = "Auto, Fired, Red-eye reduction")]
- AutoFiredRedEye = 89,
- [Display(Name = "Auto, Fired, Red-eye reduction, Return not detected")]
- AutoFiredRedEyeNoReturn = 93,
- [Display(Name = "Auto, Fired, Red-eye reduction, Return detected")]
+ None = 0, [Display(Name = "Fired")]
+ Fired = 1, [Display(Name = "Fired, Return not detected")]
+ FiredNoReturn = 5, [Display(Name = "Fired, Return detected")]
+ FiredReturn = 7, [Display(Name = "On, Did not fire")]
+ OnDidNotFire = 8, [Display(Name = "On, Fired")]
+ OnFired = 9, [Display(Name = "On, Return not detected")]
+ OnNoReturn = 13, [Display(Name = "On, Return detected")]
+ OnReturn = 15, [Display(Name = "Off, Did not fire")]
+ OffDidNotFire = 16, [Display(Name = "Off, Did not fire, Return not detected")]
+ OffDidNotFireNoReturn = 20, [Display(Name = "Auto, Did not fire")]
+ AutoDidNotFire = 24, [Display(Name = "Auto, Fired")]
+ AutoFired = 25, [Display(Name = "Auto, Fired, Return not detected")]
+ AutoFiredNoReturn = 29, [Display(Name = "Auto, Fired, Return detected")]
+ AutoFiredReturn = 31, [Display(Name = "No flash function")]
+ NoFlash = 32, [Display(Name = "Off, No flash function")]
+ OffNoFlash = 48, [Display(Name = "Fired, Red-eye reduction")]
+ FiredRedEye = 65, [Display(Name = "Fired, Red-eye reduction, Return not detected")]
+ FiredRedEyeNoReturn = 69, [Display(Name = "Fired, Red-eye reduction, Return detected")]
+ FiredRedEyeReturn = 71, [Display(Name = "On, Red-eye reduction")]
+ OnRedEye = 73, [Display(Name = "On, Red-eye reduction, Return not detected")]
+ OnRedEyeNoReturn = 77, [Display(Name = "On, Red-eye reduction, Return detected")]
+ OnRedEyeReturn = 79, [Display(Name = "Off, Red-eye reduction")]
+ OffRedEye = 80, [Display(Name = "Auto, Did not fire, Red-eye reduction")]
+ AutoNotFireRedEye = 88, [Display(Name = "Auto, Fired, Red-eye reduction")]
+ AutoFiredRedEye = 89, [Display(Name = "Auto, Fired, Red-eye reduction, Return not detected")]
+ AutoFiredRedEyeNoReturn = 93, [Display(Name = "Auto, Fired, Red-eye reduction, Return detected")]
AutoFiredRedEyeReturn = 95
}
public enum LightSource : ushort
{
[Display(Name = "Unknown")]
- Unknown = 0,
- [Display(Name = "Daylight")]
- Daylight = 1,
- [Display(Name = "Fluorescent")]
- Fluorescent = 2,
- [Display(Name = "Tungsten (Incandescent)")]
- Incandescent = 3,
- [Display(Name = "Flash")]
- Flash = 4,
- [Display(Name = "Fine Weather")]
- FineWeather = 9,
- [Display(Name = "Cloudy")]
- Cloudy = 10,
- [Display(Name = "Shade")]
- Shade = 11,
- [Display(Name = "Daylight Fluorescent")]
- DaylightFluorescent = 12,
- [Display(Name = "Day White Fluorescent")]
- DayWhiteFluorescent = 13,
- [Display(Name = "Cool White Fluorescent")]
- CoolWhiteFluorescent = 14,
- [Display(Name = "White Fluorescent")]
- WhiteFluorescent = 15,
- [Display(Name = "Warm White Fluorescent")]
- WarmWhiteFluorescent = 16,
- [Display(Name = "Standard Light A")]
- StandardLightA = 17,
- [Display(Name = "Standard Light B")]
- StandardLightB = 18,
- [Display(Name = "Standard Light C")]
- StandardLightC = 19,
- [Display(Name = "D55")]
- D55 = 20,
- [Display(Name = "D65")]
- D65 = 21,
- [Display(Name = "D75")]
- D75 = 22,
- [Display(Name = "D50")]
- D50 = 23,
- [Display(Name = "ISO Studio Tungsten")]
- ISOStudioTungsten = 24,
- [Display(Name = "Other")]
+ Unknown = 0, [Display(Name = "Daylight")]
+ Daylight = 1, [Display(Name = "Fluorescent")]
+ Fluorescent = 2, [Display(Name = "Tungsten (Incandescent)")]
+ Incandescent = 3, [Display(Name = "Flash")]
+ Flash = 4, [Display(Name = "Fine Weather")]
+ FineWeather = 9, [Display(Name = "Cloudy")]
+ Cloudy = 10, [Display(Name = "Shade")]
+ Shade = 11, [Display(Name = "Daylight Fluorescent")]
+ DaylightFluorescent = 12, [Display(Name = "Day White Fluorescent")]
+ DayWhiteFluorescent = 13, [Display(Name = "Cool White Fluorescent")]
+ CoolWhiteFluorescent = 14, [Display(Name = "White Fluorescent")]
+ WhiteFluorescent = 15, [Display(Name = "Warm White Fluorescent")]
+ WarmWhiteFluorescent = 16, [Display(Name = "Standard Light A")]
+ StandardLightA = 17, [Display(Name = "Standard Light B")]
+ StandardLightB = 18, [Display(Name = "Standard Light C")]
+ StandardLightC = 19, [Display(Name = "D55")]
+ D55 = 20, [Display(Name = "D65")]
+ D65 = 21, [Display(Name = "D75")]
+ D75 = 22, [Display(Name = "D50")]
+ D50 = 23, [Display(Name = "ISO Studio Tungsten")]
+ ISOStudioTungsten = 24, [Display(Name = "Other")]
Other = 255
}
public enum MeteringMode : ushort
{
[Display(Name = "Unknown")]
- Unknown = 0,
- [Display(Name = "Average")]
- Average = 1,
- [Display(Name = "Center-weighted average")]
- CenterWeightedAverage = 2,
- [Display(Name = "Spot")]
- Spot = 3,
- [Display(Name = "Multi-spot")]
- MultiSpot = 4,
- [Display(Name = "Multi-segment")]
- MultiSegment = 5,
- [Display(Name = "Partial")]
- Partial = 6,
- [Display(Name = "Other")]
+ Unknown = 0, [Display(Name = "Average")]
+ Average = 1, [Display(Name = "Center-weighted average")]
+ CenterWeightedAverage = 2, [Display(Name = "Spot")]
+ Spot = 3, [Display(Name = "Multi-spot")]
+ MultiSpot = 4, [Display(Name = "Multi-segment")]
+ MultiSegment = 5, [Display(Name = "Partial")]
+ Partial = 6, [Display(Name = "Other")]
Other = 255
}
public enum Orientation : ushort
{
[Display(Name = "Horizontal (normal)")]
- Horizontal = 1,
- [Display(Name = "Mirror horizontal")]
- MirrorHorizontal = 2,
- [Display(Name = "Rotate 180")]
- Rotate180 = 3,
- [Display(Name = "Mirror vertical")]
- MirrorVertical = 4,
- [Display(Name = "Mirror horizontal and rotate 270 CW")]
- MirrorHorizontalAndRotate270CW = 5,
- [Display(Name = "Rotate 90 CW")]
- Rotate90CW = 6,
- [Display(Name = "Mirror horizontal and rotate 90 CW")]
- MirrorHorizontalAndRotate90CW = 7,
- [Display(Name = "Rotate 270 CW")]
+ Horizontal = 1, [Display(Name = "Mirror horizontal")]
+ MirrorHorizontal = 2, [Display(Name = "Rotate 180")]
+ Rotate180 = 3, [Display(Name = "Mirror vertical")]
+ MirrorVertical = 4, [Display(Name = "Mirror horizontal and rotate 270 CW")]
+ MirrorHorizontalAndRotate270CW = 5, [Display(Name = "Rotate 90 CW")]
+ Rotate90CW = 6, [Display(Name = "Mirror horizontal and rotate 90 CW")]
+ MirrorHorizontalAndRotate90CW = 7, [Display(Name = "Rotate 270 CW")]
Rotate270CW = 8
}
public enum ResolutionUnit : ushort
{
- None = 1,
- Inches = 2,
- Centimeters = 3
+ None = 1, Inches = 2, Centimeters = 3
}
public enum Saturation : ushort
{
- Normal = 0,
- Low = 1,
- Hig = 2
+ Normal = 0, Low = 1, Hig = 2
}
public enum SceneCaptureType : ushort
{
- Standard = 0,
- Landscape = 1,
- Portrait = 2,
- Night = 3
+ Standard = 0, Landscape = 1, Portrait = 2,
+ Night = 3
}
public enum SensingMethod : ushort
{
[Display(Name = "Not defined")]
- Undefined = 1,
- [Display(Name = "One-chip color area")]
- OneChipColorArea = 2,
- [Display(Name = "Two-chip color area")]
- TwoChipColorArea = 3,
- [Display(Name = "Three-chip color area")]
- ThreeChipColorArea = 4,
- [Display(Name = "Color sequential area")]
- ColorSequentialArea = 5,
- [Display(Name = "Trilinear")]
- Trilinear = 7,
- [Display(Name = "Color sequential linear")]
+ Undefined = 1, [Display(Name = "One-chip color area")]
+ OneChipColorArea = 2, [Display(Name = "Two-chip color area")]
+ TwoChipColorArea = 3, [Display(Name = "Three-chip color area")]
+ ThreeChipColorArea = 4, [Display(Name = "Color sequential area")]
+ ColorSequentialArea = 5, [Display(Name = "Trilinear")]
+ Trilinear = 7, [Display(Name = "Color sequential linear")]
ColorSequentialLinear = 8
}
public enum SubjectDistanceRange : ushort
{
- Unknown = 0,
- Macro = 1,
- Close = 2,
+ Unknown = 0, Macro = 1, Close = 2,
Distant = 3
}
public enum WhiteBalance : ushort
{
- Auto = 0,
- Manual = 1
+ Auto = 0, Manual = 1
}
public enum Sharpness : ushort
{
- Normal = 0,
- Low = 1,
- Hig = 2
+ Normal = 0, Low = 1, Hig = 2
}
}
\ No newline at end of file
diff --git a/Marechai.Database/IDbCore.cs b/Marechai.Database/IDbCore.cs
index cab322a6..b8f89611 100644
--- a/Marechai.Database/IDbCore.cs
+++ b/Marechai.Database/IDbCore.cs
@@ -41,9 +41,7 @@ namespace Marechai.Database
/// Last inserted row's ID
long LastInsertRowId { get; }
- ///
- /// Opens an existing database
- ///
+ /// Opens an existing database
/// Server
/// User
/// Database name
@@ -52,14 +50,10 @@ namespace Marechai.Database
/// true if database opened correctly, false otherwise
bool OpenDb(string server, string user, string database, string password, ushort port);
- ///
- /// Closes the database
- ///
+ /// Closes the database
void CloseDb();
- ///
- /// Gets a data adapter for the opened database
- ///
+ /// Gets a data adapter for the opened database
/// Data adapter
IDbDataAdapter GetNewDataAdapter();
diff --git a/Marechai.Database/Migrations/20180805214952_InitialMigration.cs b/Marechai.Database/Migrations/20180805214952_InitialMigration.cs
index e6aa9c01..c1905a40 100644
--- a/Marechai.Database/Migrations/20180805214952_InitialMigration.cs
+++ b/Marechai.Database/Migrations/20180805214952_InitialMigration.cs
@@ -38,603 +38,473 @@ namespace Marechai.Database.Migrations
{
protected override void Up(MigrationBuilder migrationBuilder)
{
- migrationBuilder.CreateTable("admins",
- table => new
- {
- id = table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- user =
- table.Column("char(50)", nullable: false,
- defaultValueSql: "''"),
- password = table.Column("char(50)", nullable: false,
- defaultValueSql: "''")
- }, constraints: table => { table.PrimaryKey("PK_admins", x => x.id); });
+ migrationBuilder.CreateTable("admins", table => new
+ {
+ id = table.Column("int(11)").
+ Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ user = table.Column("char(50)", nullable: false, defaultValueSql: "''"),
+ password = table.Column("char(50)", nullable: false, defaultValueSql: "''")
+ }, constraints: table =>
+ {
+ table.PrimaryKey("PK_admins", x => x.id);
+ });
- migrationBuilder.CreateTable("browser_tests",
- table => new
- {
- id =
- table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- user_agent =
- table.Column("varchar(128)", nullable: false,
- defaultValueSql: "''"),
- browser =
- table.Column("varchar(64)", nullable: false,
- defaultValueSql: "''"),
- version =
- table.Column("varchar(16)", nullable: false,
- defaultValueSql: "''"),
- os =
- table.Column("varchar(32)", nullable: false,
- defaultValueSql: "''"),
- platform =
- table.Column("varchar(8)", nullable: false,
- defaultValueSql: "''"),
- gif87 =
- table.Column("tinyint(1)", nullable: false,
- defaultValueSql: "'0'"),
- gif89 =
- table.Column("tinyint(1)", nullable: false,
- defaultValueSql: "'0'"),
- jpeg =
- table.Column("tinyint(1)", nullable: false,
- defaultValueSql: "'0'"),
- png =
- table.Column("tinyint(1)", nullable: false,
- defaultValueSql: "'0'"),
- pngt =
- table.Column("tinyint(1)", nullable: false,
- defaultValueSql: "'0'"),
- agif =
- table.Column("tinyint(1)", nullable: false,
- defaultValueSql: "'0'"),
- table =
- table.Column("tinyint(1)", nullable: false,
- defaultValueSql: "'0'"),
- colors =
- table.Column("tinyint(1)", nullable: false,
- defaultValueSql: "'0'"),
- js =
- table.Column("tinyint(1)", nullable: false,
- defaultValueSql: "'0'"),
- frames =
- table.Column("tinyint(1)", nullable: false,
- defaultValueSql: "'0'"),
- flash = table.Column("tinyint(1)", nullable: false,
- defaultValueSql: "'0'")
- }, constraints: table => { table.PrimaryKey("PK_browser_tests", x => x.id); });
+ migrationBuilder.CreateTable("browser_tests", table => new
+ {
+ id = table.Column("int(11)").
+ Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ user_agent = table.Column("varchar(128)", nullable: false, defaultValueSql: "''"),
+ browser = table.Column("varchar(64)", nullable: false, defaultValueSql: "''"),
+ version = table.Column("varchar(16)", nullable: false, defaultValueSql: "''"),
+ os = table.Column("varchar(32)", nullable: false, defaultValueSql: "''"),
+ platform = table.Column("varchar(8)", nullable: false, defaultValueSql: "''"),
+ gif87 = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"),
+ gif89 = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"),
+ jpeg = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"),
+ png = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"),
+ pngt = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"),
+ agif = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"),
+ table = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"),
+ colors = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"),
+ js = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"),
+ frames = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"),
+ flash = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'")
+ }, constraints: table =>
+ {
+ table.PrimaryKey("PK_browser_tests", x => x.id);
+ });
- migrationBuilder.CreateTable("marechai_db",
- table => new
- {
- id = table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- version = table.Column("int(11)", nullable: false),
- updated = table.Column("timestamp", nullable: true,
- defaultValueSql: "CURRENT_TIMESTAMP")
- }, constraints: table => { table.PrimaryKey("PK_marechai_db", x => x.id); });
+ migrationBuilder.CreateTable("marechai_db", table => new
+ {
+ id = table.Column("int(11)").
+ Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ version = table.Column("int(11)"),
+ updated = table.Column("timestamp", nullable: true,
+ defaultValueSql: "CURRENT_TIMESTAMP")
+ }, constraints: table =>
+ {
+ table.PrimaryKey("PK_marechai_db", x => x.id);
+ });
- migrationBuilder.CreateTable("forbidden",
- table => new
- {
- id =
- table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- browser =
- table.Column("char(128)", nullable: false,
- defaultValueSql: "''"),
- date =
- table.Column("char(20)", nullable: false,
- defaultValueSql: "''"),
- ip = table.Column("char(16)", nullable: false,
- defaultValueSql: "''"),
- referer = table.Column("char(255)", nullable: false,
- defaultValueSql: "''")
- }, constraints: table => { table.PrimaryKey("PK_forbidden", x => x.id); });
+ migrationBuilder.CreateTable("forbidden", table => new
+ {
+ id = table.Column("int(11)").
+ Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ browser = table.Column("char(128)", nullable: false, defaultValueSql: "''"),
+ date = table.Column("char(20)", nullable: false, defaultValueSql: "''"),
+ ip = table.Column("char(16)", nullable: false, defaultValueSql: "''"),
+ referer = table.Column("char(255)", nullable: false, defaultValueSql: "''")
+ }, constraints: table =>
+ {
+ table.PrimaryKey("PK_forbidden", x => x.id);
+ });
- migrationBuilder.CreateTable("instruction_set_extensions",
- table => new
- {
- id = table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- extension = table.Column("varchar(45)", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_instruction_set_extensions", x => x.id);
- });
+ migrationBuilder.CreateTable("instruction_set_extensions", table => new
+ {
+ id = table.Column("int(11)").
+ Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ extension = table.Column("varchar(45)")
+ }, constraints: table =>
+ {
+ table.PrimaryKey("PK_instruction_set_extensions", x => x.id);
+ });
- migrationBuilder.CreateTable("instruction_sets",
- table => new
- {
- id = table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- instruction_set = table.Column("varchar(45)", nullable: false)
- },
- constraints: table => { table.PrimaryKey("PK_instruction_sets", x => x.id); });
+ migrationBuilder.CreateTable("instruction_sets", table => new
+ {
+ id = table.Column("int(11)").
+ Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ instruction_set = table.Column("varchar(45)")
+ }, constraints: table =>
+ {
+ table.PrimaryKey("PK_instruction_sets", x => x.id);
+ });
- migrationBuilder.CreateTable("iso3166_1_numeric",
- table => new
- {
- id = table.Column("smallint(3)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- name = table.Column("varchar(64)", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_iso3166_1_numeric", x => x.id);
- });
+ migrationBuilder.CreateTable("iso3166_1_numeric", table => new
+ {
+ id = table.Column("smallint(3)").
+ Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ name = table.Column("varchar(64)")
+ }, constraints: table =>
+ {
+ table.PrimaryKey("PK_iso3166_1_numeric", x => x.id);
+ });
- migrationBuilder.CreateTable("log",
- table => new
- {
- id =
- table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- browser =
- table.Column("char(128)", nullable: false,
- defaultValueSql: "''"),
- ip =
- table.Column("char(16)", nullable: false,
- defaultValueSql: "''"),
- date =
- table.Column("char(20)", nullable: false,
- defaultValueSql: "''"),
- referer = table.Column("char(255)", nullable: false,
- defaultValueSql: "''")
- }, constraints: table => { table.PrimaryKey("PK_log", x => x.id); });
+ migrationBuilder.CreateTable("log", table => new
+ {
+ id = table.Column("int(11)").
+ Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ browser = table.Column("char(128)", nullable: false, defaultValueSql: "''"),
+ ip = table.Column("char(16)", nullable: false, defaultValueSql: "''"),
+ date = table.Column("char(20)", nullable: false, defaultValueSql: "''"),
+ referer = table.Column("char(255)", nullable: false, defaultValueSql: "''")
+ }, constraints: table =>
+ {
+ table.PrimaryKey("PK_log", x => x.id);
+ });
- migrationBuilder.CreateTable("money_donations",
- table => new
- {
- id = table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- donator =
- table.Column("char(128)", nullable: false,
- defaultValueSql: "''"),
- quantity = table.Column("decimal(11,2)", nullable: false,
- defaultValueSql: "'0.00'")
- },
- constraints: table => { table.PrimaryKey("PK_money_donations", x => x.id); });
+ migrationBuilder.CreateTable("money_donations", table => new
+ {
+ id = table.Column("int(11)").
+ Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ donator = table.Column("char(128)", nullable: false, defaultValueSql: "''"),
+ quantity = table.Column("decimal(11,2)", nullable: false, defaultValueSql: "'0.00'")
+ }, constraints: table =>
+ {
+ table.PrimaryKey("PK_money_donations", x => x.id);
+ });
- migrationBuilder.CreateTable("news",
- table => new
- {
- id = table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- date =
- table.Column("char(20)", nullable: false,
- defaultValueSql: "''"),
- type =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- added_id = table.Column("int(11)", nullable: false,
- defaultValueSql: "'0'")
- }, constraints: table => { table.PrimaryKey("PK_news", x => x.id); });
+ migrationBuilder.CreateTable("news", table => new
+ {
+ id = table.Column("int(11)").
+ Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ date = table.Column("char(20)", nullable: false, defaultValueSql: "''"),
+ type = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ added_id = table.Column("int(11)", nullable: false, defaultValueSql: "'0'")
+ }, constraints: table =>
+ {
+ table.PrimaryKey("PK_news", x => x.id);
+ });
- migrationBuilder.CreateTable("owned_computers",
- table => new
- {
- id =
- table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- db_id =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- date =
- table.Column("varchar(20)", nullable: false,
- defaultValueSql: "''"),
- status =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- trade =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- boxed =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- manuals =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- cpu1 =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- mhz1 =
- table.Column("decimal(10,0)", nullable: false,
- defaultValueSql: "'0'"),
- cpu2 =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- mhz2 =
- table.Column("decimal(10,0)", nullable: false,
- defaultValueSql: "'0'"),
- ram =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- vram =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- rigid =
- table.Column("varchar(64)", nullable: false,
- defaultValueSql: "''"),
- disk1 =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- cap1 =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- disk2 =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- cap2 = table.Column("int(11)", nullable: false,
- defaultValueSql: "'0'")
- },
- constraints: table => { table.PrimaryKey("PK_owned_computers", x => x.id); });
+ migrationBuilder.CreateTable("owned_computers", table => new
+ {
+ id = table.Column("int(11)").
+ Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ db_id = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ date = table.Column("varchar(20)", nullable: false, defaultValueSql: "''"),
+ status = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ trade = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ boxed = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ manuals = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ cpu1 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ mhz1 = table.Column("decimal(10,0)", nullable: false, defaultValueSql: "'0'"),
+ cpu2 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ mhz2 = table.Column("decimal(10,0)", nullable: false, defaultValueSql: "'0'"),
+ ram = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ vram = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ rigid = table.Column("varchar(64)", nullable: false, defaultValueSql: "''"),
+ disk1 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ cap1 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ disk2 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ cap2 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'")
+ }, constraints: table =>
+ {
+ table.PrimaryKey("PK_owned_computers", x => x.id);
+ });
- migrationBuilder.CreateTable("owned_consoles",
- table => new
- {
- id =
- table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- db_id =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- date =
- table.Column("char(20)", nullable: false,
- defaultValueSql: "''"),
- status =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- trade =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- boxed =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- manuals = table.Column("int(11)", nullable: false,
- defaultValueSql: "'0'")
- }, constraints: table => { table.PrimaryKey("PK_owned_consoles", x => x.id); });
+ migrationBuilder.CreateTable("owned_consoles", table => new
+ {
+ id = table.Column("int(11)").
+ Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ db_id = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ date = table.Column("char(20)", nullable: false, defaultValueSql: "''"),
+ status = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ trade = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ boxed = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ manuals = table.Column("int(11)", nullable: false, defaultValueSql: "'0'")
+ }, constraints: table =>
+ {
+ table.PrimaryKey("PK_owned_consoles", x => x.id);
+ });
- migrationBuilder.CreateTable("resolutions",
- table => new
- {
- id =
- table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- width =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- height =
- table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
- colors = table.Column("bigint(20)", nullable: true),
- palette = table.Column("bigint(20)", nullable: true),
- chars = table.Column("tinyint(1)", nullable: false,
- defaultValueSql: "'0'")
- }, constraints: table => { table.PrimaryKey("PK_resolutions", x => x.id); });
+ migrationBuilder.CreateTable("resolutions", table => new
+ {
+ id = table.Column("int(11)").
+ Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ width = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ height = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"),
+ colors = table.Column("bigint(20)", nullable: true),
+ palette = table.Column("bigint(20)", nullable: true),
+ chars = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'")
+ }, constraints: table =>
+ {
+ table.PrimaryKey("PK_resolutions", x => x.id);
+ });
- migrationBuilder.CreateTable("companies",
- table => new
- {
- id =
- table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- name =
- table.Column("varchar(128)", nullable: false,
- defaultValueSql: "''"),
- founded = table.Column("datetime", nullable: true),
- website = table.Column("varchar(255)", nullable: true),
- twitter = table.Column("varchar(45)", nullable: true),
- facebook = table.Column("varchar(45)", nullable: true),
- sold = table.Column("datetime", nullable: true),
- sold_to = table.Column("int(11)", nullable: true),
- address = table.Column("varchar(80)", nullable: true),
- city = table.Column("varchar(80)", nullable: true),
- province = table.Column("varchar(80)", nullable: true),
- postal_code = table.Column("varchar(25)", nullable: true),
- country = table.Column("smallint(3)", nullable: true),
- status = table.Column("int(11)", nullable: false)
- }, constraints: table =>
- {
- table.PrimaryKey("PK_companies", x => x.id);
- table.ForeignKey("fk_companies_country", x => x.country,
- "iso3166_1_numeric", "id",
- onDelete: ReferentialAction.Restrict);
- table.ForeignKey("fk_companies_sold_to", x => x.sold_to, "companies", "id",
- onDelete: ReferentialAction.Restrict);
- });
+ migrationBuilder.CreateTable("companies", table => new
+ {
+ id = table.Column("int(11)").
+ Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ name = table.Column("varchar(128)", nullable: false, defaultValueSql: "''"),
+ founded = table.Column("datetime", nullable: true),
+ website = table.Column("varchar(255)", nullable: true),
+ twitter = table.Column("varchar(45)", nullable: true),
+ facebook = table.Column("varchar(45)", nullable: true),
+ sold = table.Column("datetime", nullable: true),
+ sold_to = table.Column("int(11)", nullable: true),
+ address = table.Column("varchar(80)", nullable: true),
+ city = table.Column("varchar(80)", nullable: true),
+ province = table.Column("varchar(80)", nullable: true),
+ postal_code = table.Column("varchar(25)", nullable: true),
+ country = table.Column("smallint(3)", nullable: true), status = table.Column("int(11)")
+ }, constraints: table =>
+ {
+ table.PrimaryKey("PK_companies", x => x.id);
- migrationBuilder.CreateTable("company_descriptions",
- table => new
- {
- id = table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- company_id = table.Column("int(11)", nullable: false),
- text = table.Column("text", nullable: true)
- }, constraints: table =>
- {
- table.PrimaryKey("PK_company_descriptions", x => x.id);
- table.ForeignKey("fk_company_id", x => x.id, "companies", "id",
- onDelete: ReferentialAction.Cascade);
- });
+ table.ForeignKey("fk_companies_country", x => x.country, "iso3166_1_numeric", "id",
+ onDelete: ReferentialAction.Restrict);
- migrationBuilder.CreateTable("company_logos",
- table => new
- {
- id = table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- company_id = table.Column("int(11)", nullable: false),
- year = table.Column("int(4)", nullable: true),
- logo_guid = table.Column("char(36)", nullable: false)
- }, constraints: table =>
- {
- table.PrimaryKey("PK_company_logos",
- x => new {x.id, x.company_id, x.logo_guid});
- table.ForeignKey("fk_company_logos_company1", x => x.company_id,
- "companies", "id", onDelete: ReferentialAction.Restrict);
- });
+ table.ForeignKey("fk_companies_sold_to", x => x.sold_to, "companies", "id",
+ onDelete: ReferentialAction.Restrict);
+ });
- migrationBuilder.CreateTable("gpus",
- table => new
- {
- id =
- table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- name =
- table.Column("char(128)", nullable: false,
- defaultValueSql: "''"),
- company = table.Column("int(11)", nullable: true),
- model_code = table.Column("varchar(45)", nullable: true),
- introduced = table.Column("datetime", nullable: true),
- package = table.Column("varchar(45)", nullable: true),
- process = table.Column("varchar(45)", nullable: true),
- process_nm = table.Column(nullable: true),
- die_size = table.Column(nullable: true),
- transistors = table.Column("bigint(20)", nullable: true)
- }, constraints: table =>
- {
- table.PrimaryKey("PK_gpus", x => x.id);
- table.ForeignKey("fk_gpus_company", x => x.company, "companies", "id",
- onDelete: ReferentialAction.Restrict);
- });
+ migrationBuilder.CreateTable("company_descriptions", table => new
+ {
+ id = table.Column("int(11)").
+ Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ company_id = table.Column("int(11)"), text = table.Column("text", nullable: true)
+ }, constraints: table =>
+ {
+ table.PrimaryKey("PK_company_descriptions", x => x.id);
+ table.ForeignKey("fk_company_id", x => x.id, "companies", "id", onDelete: ReferentialAction.Cascade);
+ });
- migrationBuilder.CreateTable("machine_families",
- table => new
- {
- id = table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- company = table.Column("int(11)", nullable: false),
- name = table.Column("varchar(255)", nullable: false)
- }, constraints: table =>
- {
- table.PrimaryKey("PK_machine_families", x => x.id);
- table.ForeignKey("fk_machine_families_company", x => x.company,
- "companies", "id", onDelete: ReferentialAction.Cascade);
- });
+ migrationBuilder.CreateTable("company_logos", table => new
+ {
+ id = table.Column("int(11)").
+ Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ company_id = table.Column("int(11)"), year = table.Column("int(4)", nullable: true),
+ logo_guid = table.Column("char(36)")
+ }, constraints: table =>
+ {
+ table.PrimaryKey("PK_company_logos", x => new
+ {
+ x.id, x.company_id, x.logo_guid
+ });
- migrationBuilder.CreateTable("processors",
- table => new
- {
- id =
- table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- name =
- table.Column("char(50)", nullable: false,
- defaultValueSql: "''"),
- company = table.Column("int(11)", nullable: true),
- model_code = table.Column("varchar(45)", nullable: true),
- introduced = table.Column("datetime", nullable: true),
- instruction_set = table.Column("int(11)", nullable: true),
- speed = table.Column(nullable: true),
- package = table.Column("varchar(45)", nullable: true),
- GPRs = table.Column("int(11)", nullable: true),
- GPR_size = table.Column("int(11)", nullable: true),
- FPRs = table.Column("int(11)", nullable: true),
- FPR_size = table.Column("int(11)", nullable: true),
- cores = table.Column("int(11)", nullable: true),
- threads_per_core = table.Column("int(11)", nullable: true),
- process = table.Column("varchar(45)", nullable: true),
- process_nm = table.Column(nullable: true),
- die_size = table.Column(nullable: true),
- transistors = table.Column("bigint(20)", nullable: true),
- data_bus = table.Column("int(11)", nullable: true),
- addr_bus = table.Column("int(11)", nullable: true),
- SIMD_registers = table.Column("int(11)", nullable: true),
- SIMD_size = table.Column("int(11)", nullable: true),
- L1_instruction = table.Column(nullable: true),
- L1_data = table.Column(nullable: true),
- L2 = table.Column(nullable: true),
- L3 = table.Column(nullable: true)
- }, constraints: table =>
- {
- table.PrimaryKey("PK_processors", x => x.id);
- table.ForeignKey("fk_processors_company", x => x.company, "companies",
- "id", onDelete: ReferentialAction.Restrict);
- table.ForeignKey("fk_processors_instruction_set", x => x.instruction_set,
- "instruction_sets", "id",
- onDelete: ReferentialAction.Restrict);
- });
+ table.ForeignKey("fk_company_logos_company1", x => x.company_id, "companies", "id",
+ onDelete: ReferentialAction.Restrict);
+ });
- migrationBuilder.CreateTable("sound_synths",
- table => new
- {
- id =
- table.Column("int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy",
- MySqlValueGenerationStrategy.IdentityColumn),
- name =
- table.Column("char(50)", nullable: false,
- defaultValueSql: "''"),
- company = table.Column("int(11)", nullable: true),
- model_code = table.Column("varchar(45)", nullable: true),
- introduced = table.Column("datetime", nullable: true),
- voices = table.Column("int(11)", nullable: true),
- frequency = table.Column(nullable: true),
- depth = table.Column("int(11)", nullable: true),
- square_wave = table.Column("int(11)", nullable: true),
- white_noise = table.Column("int(11)", nullable: true),
- type = table.Column("int(11)", nullable: true)
- }, constraints: table =>
- {
- table.PrimaryKey("PK_sound_synths", x => x.id);
- table.ForeignKey("fk_sound_synths_company", x => x.company, "companies",
- "id", onDelete: ReferentialAction.Restrict);
- });
+ migrationBuilder.CreateTable("gpus", table => new
+ {
+ id = table.Column("int(11)").
+ Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ name = table.Column("char(128)", nullable: false, defaultValueSql: "''"),
+ company = table.Column("int(11)", nullable: true),
+ model_code = table.Column("varchar(45)", nullable: true),
+ introduced = table.Column("datetime", nullable: true),
+ package = table.Column("varchar(45)", nullable: true),
+ process = table.Column("varchar(45)", nullable: true),
+ process_nm = table.Column(nullable: true), die_size = table.Column