mirror of
https://github.com/teslamate-org/teslamate.git
synced 2026-01-24 21:06:08 +08:00
18 lines
389 B
Elixir
18 lines
389 B
Elixir
defmodule TeslaMate.Repo.Migrations.CreateCar do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
create table(:cars) do
|
|
add(:eid, :bigint, null: false)
|
|
add(:vid, :bigint, null: false)
|
|
add(:model, :string, null: false)
|
|
add(:efficiency, :float, null: false)
|
|
|
|
timestamps()
|
|
end
|
|
|
|
create(unique_index(:cars, :eid))
|
|
create(unique_index(:cars, :vid))
|
|
end
|
|
end
|