-- SPDX-FileCopyrightText: 2024 Simon Bruder <simon@sbruder.de>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later

ALTER TABLE items
  ADD created_at TIMESTAMP WITH TIME ZONE DEFAULT now();

UPDATE items
  SET created_at = now();

ALTER TABLE items
  ALTER created_at SET NOT NULL;

ALTER TABLE item_classes
  ADD created_at TIMESTAMP WITH TIME ZONE DEFAULT now();

UPDATE item_classes
  SET created_at = now();

ALTER TABLE item_classes
  ALTER created_at SET NOT NULL;
