feat: add persistence for task
This commit is contained in:
parent
2850c18005
commit
264484c256
3 changed files with 18 additions and 0 deletions
|
|
@ -19,6 +19,8 @@
|
||||||
lexical
|
lexical
|
||||||
beam.packages.erlang_25.elixir-ls
|
beam.packages.erlang_25.elixir-ls
|
||||||
next-ls
|
next-ls
|
||||||
|
|
||||||
|
sqlite
|
||||||
]
|
]
|
||||||
++ lib.optionals stdenv.isLinux [
|
++ lib.optionals stdenv.isLinux [
|
||||||
# For ExUnit Notifier on Linux.
|
# For ExUnit Notifier on Linux.
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,11 @@ defmodule Putzplan.Tasks.Task do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sqlite do
|
||||||
|
table "tasks"
|
||||||
|
repo Putzplan.Repo
|
||||||
|
end
|
||||||
|
|
||||||
# Attributes are the simple pieces of data that exist on your resource
|
# Attributes are the simple pieces of data that exist on your resource
|
||||||
attributes do
|
attributes do
|
||||||
# Add an autogenerated UUID primary key called `:id`.
|
# Add an autogenerated UUID primary key called `:id`.
|
||||||
|
|
|
||||||
11
priv/repo/migrations/20250404184442_add_task_relation.exs
Normal file
11
priv/repo/migrations/20250404184442_add_task_relation.exs
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
defmodule Putzplan.Repo.Migrations.AddTaskRelation do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def change do
|
||||||
|
create table(:tasks, primary_key: false) do
|
||||||
|
add :id, :uuid, null: false, primary_key: true
|
||||||
|
add :description, :string, null: false
|
||||||
|
add :repetition_days, :integer, null: false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Add table
Add a link
Reference in a new issue