aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2020-05-11 14:23:15 +0300
committerSyndamia <kamen.d.mladenov@protonmail.com>2020-05-11 14:23:15 +0300
commite5cab4f8f638f510077ba7ba936e856197841de6 (patch)
tree7d69a60451c493df0c00d88dbc7f9831326a1ce5
parentaf6711f5a3054d337d5ed1c6ffd3a2ffb883d104 (diff)
downloadMundus-e5cab4f8f638f510077ba7ba936e856197841de6.tar
Mundus-e5cab4f8f638f510077ba7ba936e856197841de6.tar.gz
Mundus-e5cab4f8f638f510077ba7ba936e856197841de6.zip
Connection string is now a constant in DataBaseContexts. Fixed MySQL CREATE queries.
-rw-r--r--CREATE MySQL queries.sql36
-rw-r--r--Mundus/Data/Crafting/CraftingTableContext.cs8
-rw-r--r--Mundus/Data/DataBaseContexts.cs7
-rw-r--r--Mundus/Data/GameEventLogContext.cs8
-rw-r--r--Mundus/Data/SuperLayers/LandContext.cs8
-rw-r--r--Mundus/Data/SuperLayers/SkyContext.cs8
-rw-r--r--Mundus/Data/SuperLayers/UndergroundContext.cs8
7 files changed, 30 insertions, 53 deletions
diff --git a/CREATE MySQL queries.sql b/CREATE MySQL queries.sql
index dc5d093..6d7d585 100644
--- a/CREATE MySQL queries.sql
+++ b/CREATE MySQL queries.sql
@@ -24,65 +24,65 @@ CREATE TABLE Recipes (
-- Sky SuperLayer tables
CREATE TABLE SMobLayer(
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
- XPos INT NOT NULL UNIQUE,
- YPos INT NOT NULL UNIQUE,
+ XPos INT NOT NULL,
+ YPos INT NOT NULL,
stock_id VARCHAR(45)
);
CREATE TABLE SStructureLayer(
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
- XPos INT NOT NULL UNIQUE,
- YPos INT NOT NULL UNIQUE,
+ XPos INT NOT NULL,
+ YPos INT NOT NULL,
stock_id VARCHAR(45)
);
CREATE TABLE SGroundLayer(
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
- XPos INT NOT NULL UNIQUE,
- YPos INT NOT NULL UNIQUE,
+ XPos INT NOT NULL,
+ YPos INT NOT NULL,
stock_id VARCHAR(45)
);
-- Land SuperLayer tables
CREATE TABLE LMobLayer(
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
- XPos INT NOT NULL UNIQUE,
- YPos INT NOT NULL UNIQUE,
+ XPos INT NOT NULL,
+ YPos INT NOT NULL,
stock_id VARCHAR(45)
);
CREATE TABLE LStructureLayer(
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
- XPos INT NOT NULL UNIQUE,
- YPos INT NOT NULL UNIQUE,
+ XPos INT NOT NULL,
+ YPos INT NOT NULL,
stock_id VARCHAR(45)
);
CREATE TABLE LGroundLayer(
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
- XPos INT NOT NULL UNIQUE,
- YPos INT NOT NULL UNIQUE,
+ XPos INT NOT NULL,
+ YPos INT NOT NULL,
stock_id VARCHAR(45)
);
-- Underground SuperLayer tables
CREATE TABLE UMobLayer(
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
- XPos INT NOT NULL UNIQUE,
- YPos INT NOT NULL UNIQUE,
+ XPos INT NOT NULL,
+ YPos INT NOT NULL,
stock_id VARCHAR(45)
);
CREATE TABLE UStructureLayer(
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
- XPos INT NOT NULL UNIQUE,
- YPos INT NOT NULL UNIQUE,
+ XPos INT NOT NULL,
+ YPos INT NOT NULL,
stock_id VARCHAR(45)
);
CREATE TABLE UGroundLayer(
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
- XPos INT NOT NULL UNIQUE,
- YPos INT NOT NULL UNIQUE,
+ XPos INT NOT NULL,
+ YPos INT NOT NULL,
stock_id VARCHAR(45)
); \ No newline at end of file
diff --git a/Mundus/Data/Crafting/CraftingTableContext.cs b/Mundus/Data/Crafting/CraftingTableContext.cs
index 760131a..6f7c6bb 100644
--- a/Mundus/Data/Crafting/CraftingTableContext.cs
+++ b/Mundus/Data/Crafting/CraftingTableContext.cs
@@ -39,13 +39,7 @@ namespace Mundus.Data.Crafting {
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
- optionsBuilder.UseMySQL(
- "server=localhost;" +
- "port=3306;" +
- "user id=root; " +
- "password=password; " +
- "database=Mundus; " +
- "SslMode=none");
+ optionsBuilder.UseMySQL(DataBaseContexts.ConnectionStringMySQL);
}
}
}
diff --git a/Mundus/Data/DataBaseContexts.cs b/Mundus/Data/DataBaseContexts.cs
index 18e75c9..77425c2 100644
--- a/Mundus/Data/DataBaseContexts.cs
+++ b/Mundus/Data/DataBaseContexts.cs
@@ -4,6 +4,13 @@ using Mundus.Data.SuperLayers;
namespace Mundus.Data {
public static class DataBaseContexts {
+ public const string ConnectionStringMySQL = "server=localhost;" +
+ "port=3306;" +
+ "user id=root; " +
+ "password=password; " +
+ "database=Mundus; " +
+ "SslMode=none";
+
public static CraftingTableContext CTContext { get; private set; }
public static GameEventLogContext GELContext { get; private set; }
diff --git a/Mundus/Data/GameEventLogContext.cs b/Mundus/Data/GameEventLogContext.cs
index 8c7088d..eda4ffe 100644
--- a/Mundus/Data/GameEventLogContext.cs
+++ b/Mundus/Data/GameEventLogContext.cs
@@ -31,13 +31,7 @@ namespace Mundus.Data {
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
- optionsBuilder.UseMySQL(
- "server=localhost;" +
- "port=3306;" +
- "user id=root; " +
- "password=password; " +
- "database=Mundus; " +
- "SslMode=none");
+ optionsBuilder.UseMySQL(DataBaseContexts.ConnectionStringMySQL);
}
}
}
diff --git a/Mundus/Data/SuperLayers/LandContext.cs b/Mundus/Data/SuperLayers/LandContext.cs
index 89bed78..adbd9b8 100644
--- a/Mundus/Data/SuperLayers/LandContext.cs
+++ b/Mundus/Data/SuperLayers/LandContext.cs
@@ -74,13 +74,7 @@ namespace Mundus.Data.SuperLayers {
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
- optionsBuilder.UseMySQL(
- "server=localhost;" +
- "port=3306;" +
- "user id=root; " +
- "password=password; " +
- "database=Mundus; " +
- "SslMode=none");
+ optionsBuilder.UseMySQL(DataBaseContexts.ConnectionStringMySQL);
}
}
}
diff --git a/Mundus/Data/SuperLayers/SkyContext.cs b/Mundus/Data/SuperLayers/SkyContext.cs
index 8c68d2b..273f503 100644
--- a/Mundus/Data/SuperLayers/SkyContext.cs
+++ b/Mundus/Data/SuperLayers/SkyContext.cs
@@ -75,13 +75,7 @@ namespace Mundus.Data.SuperLayers {
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
- optionsBuilder.UseMySQL(
- "server=localhost;" +
- "port=3306;" +
- "user id=root; " +
- "password=password; " +
- "database=Mundus; " +
- "SslMode=none");
+ optionsBuilder.UseMySQL(DataBaseContexts.ConnectionStringMySQL);
}
}
}
diff --git a/Mundus/Data/SuperLayers/UndergroundContext.cs b/Mundus/Data/SuperLayers/UndergroundContext.cs
index ffb90a5..96a854d 100644
--- a/Mundus/Data/SuperLayers/UndergroundContext.cs
+++ b/Mundus/Data/SuperLayers/UndergroundContext.cs
@@ -74,13 +74,7 @@ namespace Mundus.Data.SuperLayers {
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
- optionsBuilder.UseMySQL(
- "server=localhost;" +
- "port=3306;" +
- "user id=root; " +
- "password=password; " +
- "database=Mundus; " +
- "SslMode=none");
+ optionsBuilder.UseMySQL(DataBaseContexts.ConnectionStringMySQL);
}
}
}