From f8f1b28ea9c2599458f94348a1fd82cef1012da9 Mon Sep 17 00:00:00 2001 From: a-ill Date: Fri, 28 Jul 2023 13:07:33 +0300 Subject: [PATCH] Added db table files --- .../2022026611846567_create_table_communes.jl | 25 ++++++++++++++ .../2022026611846567_create_table_parties.jl | 26 ++++++++++++++ ...11846568_create_table_communes_requests.jl | 34 +++++++++++++++++++ ...611846569_create_table_parties_requests.jl | 32 +++++++++++++++++ ...2026611846570_create_table_cooperatives.jl | 30 ++++++++++++++++ .../2022026611846571_create_table_partners.jl | 27 +++++++++++++++ 6 files changed, 174 insertions(+) create mode 100644 Server/db/migrations/2022026611846567_create_table_communes.jl create mode 100644 Server/db/migrations/2022026611846567_create_table_parties.jl create mode 100644 Server/db/migrations/2022026611846568_create_table_communes_requests.jl create mode 100644 Server/db/migrations/2022026611846569_create_table_parties_requests.jl create mode 100644 Server/db/migrations/2022026611846570_create_table_cooperatives.jl create mode 100644 Server/db/migrations/2022026611846571_create_table_partners.jl diff --git a/Server/db/migrations/2022026611846567_create_table_communes.jl b/Server/db/migrations/2022026611846567_create_table_communes.jl new file mode 100644 index 0000000..3c20432 --- /dev/null +++ b/Server/db/migrations/2022026611846567_create_table_communes.jl @@ -0,0 +1,25 @@ +module CreateTableCommunes + +import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table + +function up() + create_table(:communes) do + [ + primary_key() + column(:country, :string) + column(:state, :string) + column(:town, :string) + column(:contact, :string) + column(:latitude, :float) + column(:longitude, :float) + column(:members, :int) + column(:status, :string) + ] + end +end + +function down() + drop_table(:communes) +end + +end \ No newline at end of file diff --git a/Server/db/migrations/2022026611846567_create_table_parties.jl b/Server/db/migrations/2022026611846567_create_table_parties.jl new file mode 100644 index 0000000..d3b3ff4 --- /dev/null +++ b/Server/db/migrations/2022026611846567_create_table_parties.jl @@ -0,0 +1,26 @@ +module CreateTableParties + +import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table + +function up() + create_table(:parties) do + [ + primary_key() + column(:country, :string) + column(:latitude, :float) + column(:longitude, :float) + column(:logo, :string) + column(:name, :string) + column(:website, :string) + column(:contact, :string) + column(:description, :string) + column(:members, :string) + ] + end +end + +function down() + drop_table(:parties) +end + +end \ No newline at end of file diff --git a/Server/db/migrations/2022026611846568_create_table_communes_requests.jl b/Server/db/migrations/2022026611846568_create_table_communes_requests.jl new file mode 100644 index 0000000..c8abd86 --- /dev/null +++ b/Server/db/migrations/2022026611846568_create_table_communes_requests.jl @@ -0,0 +1,34 @@ +module CreateTablePartiesRequests + +import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table + +include("../../lib/DatabaseSupport.jl") +using .DatabaseSupport +import .DatabaseSupport: set_default + +function up() + create_table(:parties_requests) do + [ + primary_key() + column(:id_given, :integer) + column(:country, :string) + column(:state, :string) + column(:town, :string) + column(:contact, :string) + column(:latitude, :float) + column(:longitude, :float) + column(:status, :string) + column(:verified, :bool) + column(:added, :bool) + ] + end + + set_default("parties_requests","verified",false) + set_default("parties_requests","added",false) +end + +function down() + drop_table(:parties_requests) +end + +end \ No newline at end of file diff --git a/Server/db/migrations/2022026611846569_create_table_parties_requests.jl b/Server/db/migrations/2022026611846569_create_table_parties_requests.jl new file mode 100644 index 0000000..445ee9f --- /dev/null +++ b/Server/db/migrations/2022026611846569_create_table_parties_requests.jl @@ -0,0 +1,32 @@ +module CreateTablePartiesRequests + +import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table + +include("../../lib/DatabaseSupport.jl") +using .DatabaseSupport +import .DatabaseSupport: set_default + +function up() + create_table(:parties_requests) do + [ + primary_key() + column(:id_given, :integer) + column(:name, :string) + column(:country, :string) + column(:link, :string) + column(:latitude, :float) + column(:longitude, :float) + column(:verified, :bool) + column(:added, :bool) + ] + end + + set_default("parties_requests","verified",false) + set_default("parties_requests","added",false) +end + +function down() + drop_table(:parties_requests) +end + +end \ No newline at end of file diff --git a/Server/db/migrations/2022026611846570_create_table_cooperatives.jl b/Server/db/migrations/2022026611846570_create_table_cooperatives.jl new file mode 100644 index 0000000..1cc1a97 --- /dev/null +++ b/Server/db/migrations/2022026611846570_create_table_cooperatives.jl @@ -0,0 +1,30 @@ +module CreateTableCooperatives + +import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table + +function up() + create_table(:cooperatives) do + [ + primary_key() + column(:country, :string) + column(:state, :string) + column(:town, :string) + column(:contact, :string) + column(:latitude, :float) + column(:longitude, :float) + column(:workers, :int) + column(:status, :string) + column(:logo, :string) + column(:name, :string) + column(:market, :string) + column(:website, :string) + column(:description, :string) + ] + end +end + +function down() + drop_table(:cooperatives) +end + +end \ No newline at end of file diff --git a/Server/db/migrations/2022026611846571_create_table_partners.jl b/Server/db/migrations/2022026611846571_create_table_partners.jl new file mode 100644 index 0000000..823a53b --- /dev/null +++ b/Server/db/migrations/2022026611846571_create_table_partners.jl @@ -0,0 +1,27 @@ +module CreateTablePartners + +import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table + +function up() + create_table(:partners) do + [ + primary_key() + column(:country, :string) + column(:state, :string) + column(:town, :string) + column(:contact, :string) + column(:latitude, :float) + column(:longitude, :float) + column(:logo, :string) + column(:name, :string) + column(:website, :string) + column(:description, :string) + ] + end +end + +function down() + drop_table(:partners) +end + +end \ No newline at end of file