database schema adjustments to server/realm/scene
This commit is contained in:
parent
a102c96bb4
commit
09590edd95
79 changed files with 7100 additions and 100 deletions
26
db/schema/triggers/002_user_init.sql
Normal file
26
db/schema/triggers/002_user_init.sql
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
-- Chattyness User Initialization Trigger
|
||||
-- PostgreSQL 18
|
||||
--
|
||||
-- Trigger to initialize new users with default props and avatar.
|
||||
-- Load via: psql -f schema/triggers/002_user_init.sql
|
||||
|
||||
\set ON_ERROR_STOP on
|
||||
|
||||
BEGIN;
|
||||
|
||||
-- =============================================================================
|
||||
-- User Registration Trigger
|
||||
-- =============================================================================
|
||||
-- Automatically initializes new users with default props and avatar
|
||||
-- when they are inserted into auth.users.
|
||||
-- =============================================================================
|
||||
|
||||
CREATE TRIGGER trg_auth_users_initialize
|
||||
AFTER INSERT ON auth.users
|
||||
FOR EACH ROW
|
||||
EXECUTE FUNCTION auth.initialize_new_user_trigger();
|
||||
|
||||
COMMENT ON TRIGGER trg_auth_users_initialize ON auth.users IS
|
||||
'Initialize new users with default props and avatar on registration';
|
||||
|
||||
COMMIT;
|
||||
Loading…
Add table
Add a link
Reference in a new issue