mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-21 09:16:41 +02:00
refactor: restructure
monorepo with apps/ and services/ directories
This commit is contained in:
parent
25824ed0ac
commit
ff80aeec1f
4062 changed files with 2592 additions and 1278 deletions
|
|
@ -1,28 +0,0 @@
|
|||
-- Create schemas
|
||||
CREATE SCHEMA IF NOT EXISTS auth;
|
||||
CREATE SCHEMA IF NOT EXISTS credits;
|
||||
|
||||
-- Enable necessary extensions
|
||||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
|
||||
|
||||
-- Create enums
|
||||
CREATE TYPE auth.user_role AS ENUM ('user', 'admin', 'service');
|
||||
CREATE TYPE credits.transaction_type AS ENUM ('purchase', 'usage', 'refund', 'bonus', 'expiry', 'adjustment');
|
||||
CREATE TYPE credits.transaction_status AS ENUM ('pending', 'completed', 'failed', 'cancelled');
|
||||
|
||||
-- Grant usage on schemas
|
||||
GRANT USAGE ON SCHEMA auth TO PUBLIC;
|
||||
GRANT USAGE ON SCHEMA credits TO PUBLIC;
|
||||
|
||||
-- Create updated_at trigger function
|
||||
CREATE OR REPLACE FUNCTION update_updated_at_column()
|
||||
RETURNS TRIGGER AS $$
|
||||
BEGIN
|
||||
NEW.updated_at = NOW();
|
||||
RETURN NEW;
|
||||
END;
|
||||
$$ language 'plpgsql';
|
||||
|
||||
COMMENT ON SCHEMA auth IS 'Authentication and user management';
|
||||
COMMENT ON SCHEMA credits IS 'Credit system and transactions';
|
||||
Loading…
Add table
Add a link
Reference in a new issue