feat: Add utility scripts for dummy data generation and thumbnail copying, and enhance the item schema with an is_deleted column and default setup data.

This commit is contained in:
x
2026-01-24 18:06:22 +01:00
parent 8e233947e2
commit f23b108f9f

View File

@@ -153,6 +153,7 @@ CREATE TABLE public.items (
usernetwork character varying(40) NOT NULL,
stamp integer NOT NULL,
active boolean NOT NULL,
is_deleted boolean DEFAULT false NOT NULL,
thumb character varying(100)
);
@@ -674,6 +675,25 @@ REVOKE USAGE ON SCHEMA public FROM PUBLIC;
GRANT ALL ON SCHEMA public TO PUBLIC;
--
-- Data for default setup
--
-- Default Avatar Item (referenced by user_options default)
INSERT INTO public.items (id, src, dest, mime, size, checksum, username, userchannel, usernetwork, stamp, active, is_deleted, thumb)
VALUES (56660, 'default', 'default.png', 'image/png', 0, 'default', 'system', 'system', 'system', 0, false, false, NULL)
ON CONFLICT (id) DO NOTHING;
-- Default User 'foo' (password: 'foo')
INSERT INTO public."user" (id, login, "user", password, admin)
VALUES (1, 'foo', 'foo', '$f0ck$de94c6c92c2333990f1d42efb199bcd6:7b636e3d009a7e002a4d8b4c393bfcb601d2042d5dddd9965f20904270f268f5edbf504aab8d8091a7faec8bbd84107a9e3a6823e9f20c5245b693d8efb9664c', true)
ON CONFLICT (id) DO NOTHING;
-- Default User Options for 'foo'
INSERT INTO public.user_options (user_id, mode, theme, avatar, fullscreen)
VALUES (1, 3, 'amoled', 1, 0)
ON CONFLICT (user_id) DO NOTHING;
--
-- PostgreSQL database dump complete
--