From 5eb22fdb9cfb8f8c11afad134020a22acfa678b2 Mon Sep 17 00:00:00 2001 From: Sphericalkat Date: Tue, 7 May 2024 01:06:18 +0530 Subject: [PATCH] feat: add timestamps to paste table Signed-off-by: Sphericalkat --- .../20240507005300_add_timestamps_pastes.exs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 priv/repo/migrations/20240507005300_add_timestamps_pastes.exs diff --git a/priv/repo/migrations/20240507005300_add_timestamps_pastes.exs b/priv/repo/migrations/20240507005300_add_timestamps_pastes.exs new file mode 100644 index 0000000..0dce951 --- /dev/null +++ b/priv/repo/migrations/20240507005300_add_timestamps_pastes.exs @@ -0,0 +1,10 @@ +defmodule Ketbin.Repo.Migrations.AddTimestampsPastes do + use Ecto.Migration + + def change do + alter table(:pastes) do + add :inserted_at, :naive_datetime, null: false, default: fragment("CURRENT_TIMESTAMP") + add :updated_at, :naive_datetime, null: false, default: fragment("CURRENT_TIMESTAMP") + end + end +end