site-libsoc/Server/db/migrations/2022026611846569_create_tab...

39 lines
994 B
Julia
Raw Normal View History

2023-07-22 17:22:35 +07:00
module CreateTableGroupsRequests
import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table
include("../../lib/DatabaseSupport.jl")
using .DatabaseSupport
function up()
create_table(:groups_requests) do
[
primary_key()
2023-07-30 17:04:15 +07:00
column(:group_id, :integer)
column(:user_id, :integer)
2023-07-22 17:22:35 +07:00
column(:country, :string)
column(:state, :string)
column(:town, :string)
column(:contact, :string)
column(:latitude, :float)
column(:longitude, :float)
column(:verified, :bool)
column(:added, :bool)
]
end
2023-07-30 17:04:15 +07:00
add_foreign_key(:groups_requests,:user_id,:users,:id)
add_foreign_key(:groups_requests,:group_id,:groups,:id)
add_index(:groups_requests, :user_id)
2023-07-22 17:22:35 +07:00
set_default("groups_requests","verified",false)
set_default("groups_requests","added",false)
2023-07-30 17:04:15 +07:00
2023-07-22 17:22:35 +07:00
end
function down()
2023-07-22 17:48:47 +07:00
drop_table(:groups_requests)
2023-07-22 17:22:35 +07:00
end
end