Initial commit on Forgejo
Fresh repository history for elektrine/tarakan hosted at https://git.elektrine.com/elektrine/tarakan.
This commit is contained in:
commit
af6077b9c3
455 changed files with 78366 additions and 0 deletions
21
priv/repo/migrations/20260711192216_create_ssh_keys.exs
Normal file
21
priv/repo/migrations/20260711192216_create_ssh_keys.exs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
defmodule Tarakan.Repo.Migrations.CreateSshKeys do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:ssh_keys) do
|
||||
add :account_id, references(:accounts, on_delete: :delete_all), null: false
|
||||
add :name, :string, null: false
|
||||
add :key_type, :string, null: false
|
||||
add :public_key, :text, null: false
|
||||
add :fingerprint_sha256, :string, null: false
|
||||
add :last_used_at, :utc_datetime_usec
|
||||
|
||||
timestamps(type: :utc_datetime_usec)
|
||||
end
|
||||
|
||||
# Global uniqueness is load-bearing: SSH authentication resolves a
|
||||
# presented key to exactly one account by fingerprint.
|
||||
create unique_index(:ssh_keys, [:fingerprint_sha256])
|
||||
create index(:ssh_keys, [:account_id])
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue