fix database dump and model

This commit is contained in:
Ivanov Matvey 2025-03-14 05:05:50 +10:00
parent b4b0b6d06c
commit d7bde8f4d2
2 changed files with 4 additions and 5 deletions

View File

@ -39,7 +39,6 @@ SET default_tablespace = '';
SET default_table_access_method = heap; SET default_table_access_method = heap;
-- --
-- Name: log; Type: TABLE; Schema: public; Owner: postgres -- Name: log; Type: TABLE; Schema: public; Owner: postgres
-- --
@ -50,7 +49,7 @@ CREATE TABLE public.log (
datetime timestamp with time zone NOT NULL, datetime timestamp with time zone NOT NULL,
action public.useractions NOT NULL, action public.useractions NOT NULL,
object_id integer, object_id integer,
response smallint NOT NULL success_response boolean NOT NULL
); );
@ -84,11 +83,11 @@ ALTER SEQUENCE public.log_id_seq OWNED BY public.log.id;
ALTER TABLE ONLY public.log ALTER COLUMN id SET DEFAULT nextval('public.log_id_seq'::regclass); ALTER TABLE ONLY public.log ALTER COLUMN id SET DEFAULT nextval('public.log_id_seq'::regclass);
-- --
-- Data for Name: log; Type: TABLE DATA; Schema: public; Owner: postgres -- Data for Name: log; Type: TABLE DATA; Schema: public; Owner: postgres
-- --
INSERT INTO public.log (id, user_id, datetime, action, object_id, response) VALUES (1, 2, '2025-03-13 18:34:34.443097+00', 'FIRST_ENTRY', NULL, 200);
-- --

View File

@ -2,7 +2,7 @@ from enum import Enum
from datetime import datetime, timezone from datetime import datetime, timezone
from sqlalchemy import SMALLINT, INTEGER, TIMESTAMP from sqlalchemy import INTEGER, TIMESTAMP
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
def utc_signed_now(): def utc_signed_now():
@ -31,4 +31,4 @@ class Log(Base):
) )
action: Mapped[UserActions] action: Mapped[UserActions]
object_id: Mapped[int] = mapped_column(nullable=True) object_id: Mapped[int] = mapped_column(nullable=True)
response: Mapped[int] = mapped_column(SMALLINT) success_response: Mapped[bool]