-
Notifications
You must be signed in to change notification settings - Fork 1
/
migrations.ex
39 lines (31 loc) · 1.03 KB
/
migrations.ex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
defmodule Bonfire.Geolocate.Migrations do
@moduledoc false
use Ecto.Migration
# alias CommonsPub.Repo
# alias Needle.ULID
import Needle.Migration
@user Application.compile_env!(:bonfire, :user_schema)
# def users_table(), do: @user.__schema__(:source)
def change do
:ok =
execute(
"create extension IF NOT EXISTS postgis;",
"drop extension postgis;"
)
create_pointable_table(Bonfire.Geolocate.Geolocation) do
add(:name, :string)
add(:note, :text)
add(:mappable_address, :string)
add(:geom, :geometry)
add(:alt, :float)
add(:context_id, weak_pointer(), null: true)
add(:creator_id, weak_pointer(), null: true)
add(:published_at, :timestamptz)
add(:deleted_at, :timestamptz)
add(:disabled_at, :timestamptz)
timestamps(inserted_at: false, type: :utc_datetime_usec)
end
# require Bonfire.Geolocate.PrimaryGeolocation.Migration
# Bonfire.Geolocate.PrimaryGeolocation.Migration.migrate_primary_geolocation()
end
end