Skip to content

Database Structure #8

@lmeireles

Description

@lmeireles

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions