feat(DB)!:Change to use database pgvecto-rs

Break actual DBs and migration model
This commit is contained in:
MrFastwind
2024-12-17 21:55:51 +01:00
parent 3f2e048092
commit de7e5696c4
6 changed files with 34 additions and 26 deletions

View File

@@ -15,7 +15,6 @@
<option name="removeOrphansOnComposeDown" value="false" />
<option name="services">
<list>
<option value="mariadb" />
<option value="lactose" />
</list>
</option>

View File

@@ -24,7 +24,7 @@ if (builder.Configuration.Get<SignKeyConfiguration>()!.Key.Length<32) {
}
string? dbConnString = builder.Configuration.GetConnectionString("DefaultConnection");
string? dbConnString = builder.Configuration.GetConnectionString("PostgresConnection");
builder.Services.AddDbContext<LactoseDbContext>(
options => {

View File

@@ -7,6 +7,7 @@
}
},
"ConnectionStrings": {
"DefaultConnection": "server=mariadb;port=3306;user=root;password=testOnlyDb;database=TestDb"
"DefaultConnection": "server=database;port=3306;user=root;password=testOnlyDb;database=TestDb",
"PostgresConnection": "Server=database;Port=3306;User Id=root;Password=testOnlyDb;Database=TestDb"
}
}

View File

@@ -7,7 +7,8 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "server=localhost;port=3306;user=root;password=testOnlyDb;database=TestDb"
"DefaultConnection": "server=localhost;port=3306;user=root;password=testOnlyDb;database=TestDb",
"PostgresConnection": "Server=localhost;Port=3306;User Id=root;Password=testOnlyDb;Database=TestDb"
},
"SignKey": {
"Key": "32_CHARACTERS_KEY_IS_REQUIRED_TO_WORK"

View File

@@ -0,0 +1,4 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AControllerBase_002Ecs_002Fl_003AC_0021_003FUsers_003Fnivek_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F96a4cc66aa48dda8a9d8be8febec4a769fc143f7a86dd53ecdebfb9c3177d_003FControllerBase_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIFileInfo_002Ecs_002Fl_003AC_0021_003FUsers_003Fnivek_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F781590a6c8e24e6b9f85d75a1ac30c819918_003F47_003Fda5e789a_003FIFileInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFileInfo_002Ecs_002Fl_003AC_0021_003FUsers_003Fnivek_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F9fcad18e31a1983467a9fd4bfef344ee97d72fa4ab6ba20353b8f78db8437b1_003FFileInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>

View File

@@ -1,23 +1,26 @@
services:
lactose:
image: lactose
container_name: lactose
build:
context: .
dockerfile: Lactose/Dockerfile
ports:
- "5162:8080"
mariadb:
image: mariadb
container_name: mariadb
environment:
MYSQL_ROOT_PASSWORD: testOnlyDb
MYSQL_DATABASE: testDb
volumes:
- "dbdata:/var/lib/mysql"
ports:
- "3306:3306"
volumes:
services:
lactose:
image: lactose
container_name: lactose
build:
context: .
dockerfile: Lactose/Dockerfile
ports:
- "5162:8080"
depends_on:
- database
database:
image: tensorchord/pgvecto-rs:pg17-v0.4.0
container_name: database
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: testOnlyDb
POSTGRES_DB: testDb
volumes:
- "dbdata:/var/lib/postgresql"
ports:
- "3306:5432"
volumes:
dbdata: