Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database Structure #8

Open
lmeireles opened this issue Jan 2, 2020 · 0 comments
Open

Database Structure #8

lmeireles opened this issue Jan 2, 2020 · 0 comments
Assignees

Comments

@lmeireles
Copy link
Collaborator

lmeireles commented Jan 2, 2020

I'll put the migrations here as Ecto.Migration I think this way it'll be easier to understand the full table structure and the indexes as well.

Users

  def change do
    create table(:users, primary_key: false) do
      add :id, :binary_id, primary_key: true
      add :name, :string
      add :email, :string, null: false
      add :status, :tinyint, null: false, default: 0
      add :role, :tinyint, null: false, default: 0
      add :password_hash, :string
      add :recovery_token, :string
      add :recovery_token_created_at, :naive_datetime

      timestamps()
    end

    create index(:users, [:id])
    create index(:users, [:status])
    create index(:users, [:role])
    create unique_index(:users, [:recovery_token])
    create unique_index(:users, [:email])
  end

Address

Products

@lmeireles lmeireles self-assigned this Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant