From 4a1090ae7cd1c825b903483d908315d0c2a66be3 Mon Sep 17 00:00:00 2001 From: Michael Fliegner Date: Tue, 28 May 2024 11:17:24 +0200 Subject: [PATCH] dbuser postgres --- .vscode/extensions.json | 2 -- Manifest.toml | 4 ++-- bitemporal_testcase.ipynb | 8 ++------ dbinit.jl | 3 ++- sqlsnippets/droptables.sql | 17 ----------------- workflowtest.jl | 1 - 6 files changed, 6 insertions(+), 29 deletions(-) delete mode 100644 sqlsnippets/droptables.sql diff --git a/.vscode/extensions.json b/.vscode/extensions.json index f9945c8..c494538 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,7 +1,5 @@ { "recommendations": [ - "mtxr.sqltools-driver-pg", - "mtxr.sqltools", "julialang.language-julia" ] } \ No newline at end of file diff --git a/Manifest.toml b/Manifest.toml index ef7013d..1aa6460 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -482,9 +482,9 @@ uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.TimeZones]] deps = ["Dates", "Downloads", "InlineStrings", "Mocking", "Printf", "Scratch", "TZJData", "Unicode", "p7zip_jll"] -git-tree-sha1 = "6505890535a2b2e5145522ac77bddeda85c250c4" +git-tree-sha1 = "a6ae8d7a27940c33624f8c7bde5528de21ba730d" uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53" -version = "1.16.1" +version = "1.17.0" weakdeps = ["RecipesBase"] [deps.TimeZones.extensions] diff --git a/bitemporal_testcase.ipynb b/bitemporal_testcase.ipynb index 6bc7bd3..de6afb8 100644 --- a/bitemporal_testcase.ipynb +++ b/bitemporal_testcase.ipynb @@ -41,13 +41,9 @@ "source": [ "using SearchLight\n", "using SearchLightPostgreSQL\n", - "if !haskey(ENV, \"GENIE_ENV\")\n", - " ENV[\"GENIE_ENV\"] = \"dev\"\n", - " ENV[\"SEARCHLIGHT_USERNAME\"] = \"asa\"\n", - " ENV[\"SEARCHLIGHT_PASSWORD\"] = \"asa\"\n", - "end\n", - "run(`psql -f sqlsnippets/droptables.sql -d postgres`)\n", "SearchLight.connect(SearchLight.Configuration.load())\n", + "SearchLight.query(\"DROP SCHEMA public CASCADE\")\n", + "SearchLight.query(\"CREATE SCHEMA public\")\n", "SearchLight.Migrations.create_migrations_table()\n", "BitemporalPostgres.up()" ] diff --git a/dbinit.jl b/dbinit.jl index e3d0dd5..a203a67 100644 --- a/dbinit.jl +++ b/dbinit.jl @@ -1,6 +1,7 @@ -run(`psql -f sqlsnippets/droptables.sql`) using SearchLight using SearchLightPostgreSQL SearchLight.connect(SearchLight.Configuration.load()) +SearchLight.query("DROP SCHEMA public CASCADE") +SearchLight.query("CREATE SCHEMA public") SearchLight.Migrations.create_migrations_table() SearchLight.Migrations.up() \ No newline at end of file diff --git a/sqlsnippets/droptables.sql b/sqlsnippets/droptables.sql deleted file mode 100644 index d41d237..0000000 --- a/sqlsnippets/droptables.sql +++ /dev/null @@ -1,17 +0,0 @@ -drop table schema_migrations; -drop table partnerrevisions; -drop table partners; -drop table testdummysubcomponentrevisions; -drop table testdummysubcomponents; -drop table testdummycomponentrevisions; -drop table testdummycomponents; -drop table contractrevisions; -drop table contracts; -drop table validityintervals; -drop table workflows; -drop table versions; -drop table histories; - -drop table testtstzranges; -drop function f_versionrange; -drop function f_bitempranges; \ No newline at end of file diff --git a/workflowtest.jl b/workflowtest.jl index e66aea8..6857520 100644 --- a/workflowtest.jl +++ b/workflowtest.jl @@ -10,7 +10,6 @@ include("init.jl") using Logging, SearchLight using SearchLightPostgreSQL -# run(`psql -f sqlsnippets/droptables.sql`) SearchLight.connect(SearchLight.Configuration.load()) setfield!(SearchLight.config, :log_queries, false) setfield!(SearchLight.config, :log_level, Logging.Error)