Interim update
This commit is contained in:
@@ -8,12 +8,9 @@ function up()
|
||||
primary_key()
|
||||
column(:email, :string)
|
||||
column(:password, :string, limit = 100)
|
||||
column(:name, :string)
|
||||
column(:profile_picture, :int)
|
||||
column(:country, :int)
|
||||
column(:newsletter, :bool)
|
||||
column(:notifications, :int)
|
||||
column(:confirmation_code, :string)
|
||||
column(:google_id, :string)
|
||||
column(:verified, :bool)
|
||||
]
|
||||
end
|
||||
|
||||
|
@@ -13,8 +13,12 @@ function up()
|
||||
column(:latitude, :float)
|
||||
column(:longitude, :float)
|
||||
column(:members, :int)
|
||||
column(:user_id, :int)
|
||||
]
|
||||
end
|
||||
|
||||
add_foreign_key(:groups,:user_id,:users,:id)
|
||||
add_index(:groups, :user_id)
|
||||
end
|
||||
|
||||
function down()
|
||||
|
@@ -18,7 +18,6 @@ function up()
|
||||
column(:name, :string)
|
||||
column(:market, :string)
|
||||
column(:website, :string)
|
||||
column(:description, :string)
|
||||
]
|
||||
end
|
||||
end
|
@@ -0,0 +1,39 @@
|
||||
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()
|
||||
column(:group_id, :integer)
|
||||
column(:user_id, :integer)
|
||||
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
|
||||
|
||||
add_foreign_key(:groups_requests,:user_id,:users,:id)
|
||||
add_foreign_key(:groups_requests,:group_id,:groups,:id)
|
||||
|
||||
add_index(:groups_requests, :user_id)
|
||||
|
||||
set_default("groups_requests","verified",false)
|
||||
set_default("groups_requests","added",false)
|
||||
|
||||
end
|
||||
|
||||
function down()
|
||||
drop_table(:groups_requests)
|
||||
end
|
||||
|
||||
end
|
@@ -0,0 +1,24 @@
|
||||
module CreateTableGroupsUsers
|
||||
|
||||
import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table
|
||||
|
||||
function up()
|
||||
create_table(:groups_users) do
|
||||
[
|
||||
primary_key()
|
||||
column(:user_id, :int)
|
||||
column(:group_id, :int)
|
||||
]
|
||||
end
|
||||
|
||||
add_foreign_key(:groups_users,:user_id,:users,:id)
|
||||
add_foreign_key(:groups_users,:group_id,:groups,:id)
|
||||
add_index(:groups_users, :user_id)
|
||||
add_index(:groups_users, :group_id)
|
||||
end
|
||||
|
||||
function down()
|
||||
drop_table(:groups_users)
|
||||
end
|
||||
|
||||
end
|
@@ -0,0 +1,24 @@
|
||||
module CreateTableCommunesUsers
|
||||
|
||||
import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table
|
||||
|
||||
function up()
|
||||
create_table(:communes_users) do
|
||||
[
|
||||
primary_key()
|
||||
column(:user_id, :int)
|
||||
column(:commune_id, :int)
|
||||
]
|
||||
end
|
||||
|
||||
add_foreign_key(:communes_users,:user_id,:users,:id)
|
||||
add_foreign_key(:communes_users,:commune_id,:communes,:id)
|
||||
add_index(:communes_users, :user_id)
|
||||
add_index(:communes_users, :commune_id)
|
||||
end
|
||||
|
||||
function down()
|
||||
drop_table(:communes_users)
|
||||
end
|
||||
|
||||
end
|
@@ -0,0 +1,24 @@
|
||||
module CreateTableCooperativesUsers
|
||||
|
||||
import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table
|
||||
|
||||
function up()
|
||||
create_table(:cooperatives_users) do
|
||||
[
|
||||
primary_key()
|
||||
column(:user_id, :int)
|
||||
column(:cooperative_id, :int)
|
||||
]
|
||||
end
|
||||
|
||||
add_foreign_key(:cooperatives_users,:user_id,:users,:id)
|
||||
add_foreign_key(:cooperatives_users,:cooperative_id,:cooperatives,:id)
|
||||
add_index(:cooperatives_users, :user_id)
|
||||
add_index(:cooperatives_users, :cooperative_id)
|
||||
end
|
||||
|
||||
function down()
|
||||
drop_table(:cooperatives_users)
|
||||
end
|
||||
|
||||
end
|
@@ -0,0 +1,24 @@
|
||||
module CreateTablePartiesUsers
|
||||
|
||||
import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table
|
||||
|
||||
function up()
|
||||
create_table(:parties_users) do
|
||||
[
|
||||
primary_key()
|
||||
column(:user_id, :int)
|
||||
column(:party_id, :int)
|
||||
]
|
||||
end
|
||||
|
||||
add_foreign_key(:parties_users,:user_id,:users,:id)
|
||||
add_foreign_key(:parties_users,:party_id,:parties,:id)
|
||||
add_index(:parties_users, :user_id)
|
||||
add_index(:parties_users, :party_id)
|
||||
end
|
||||
|
||||
function down()
|
||||
drop_table(:parties_users)
|
||||
end
|
||||
|
||||
end
|
Reference in New Issue
Block a user