Added db table files

This commit is contained in:
a-ill 2023-07-28 13:07:33 +03:00
parent 90604d59ec
commit c0f60f5e68
6 changed files with 174 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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