feat: new features
This commit is contained in:
@@ -140,6 +140,26 @@ CREATE TABLE IF NOT EXISTS public.permission_translations (
|
||||
PRIMARY KEY (permission_id, locale)
|
||||
);
|
||||
|
||||
CREATE TABLE citizenship_applications (
|
||||
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
user_id uuid NOT NULL UNIQUE REFERENCES users(id) ON DELETE CASCADE,
|
||||
status text NOT NULL DEFAULT 'pending',
|
||||
region_id uuid REFERENCES regions(id),
|
||||
reviewed_by uuid REFERENCES users(id),
|
||||
reviewed_at timestamptz,
|
||||
reject_reason text,
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
);
|
||||
|
||||
CREATE TABLE citizens (
|
||||
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
user_id uuid NOT NULL UNIQUE REFERENCES users(id),
|
||||
application_id uuid NOT NULL REFERENCES citizenship_applications(id),
|
||||
number text NOT NULL UNIQUE,
|
||||
issued_at timestamptz NOT NULL DEFAULT now(),
|
||||
region_id uuid REFERENCES regions(id)
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_permission_translations_permission_id
|
||||
ON public.permission_translations (permission_id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user