Setting Initial Value of Auto-Incrementing Id in Ecto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule TestProject.Repo.Migrations.CreatePost do | |
use Ecto.Migration | |
def change do | |
create table(:posts) do | |
add :title, :string | |
add :description, :text | |
timestamps() | |
end | |
execute "ALTER SEQUENCE posts_id_seq RESTART WITH 100;" | |
end | |
end |