This commit introduces several new scripts for managing database operations, including user creation, permission grants, and data migrations. It also adds new documentation files to guide users through the setup and configuration processes. Additionally, the project structure is updated to enhance organization and maintainability, ensuring a smoother development experience for contributors. These changes support the ongoing transition to a web-based architecture and improve overall project functionality.
28 lines
1.0 KiB
SQL
28 lines
1.0 KiB
SQL
-- Grant permissions for photo_favorites table in punimtag_auth database
|
|
-- Run this as PostgreSQL superuser: sudo -u postgres psql -d punimtag_auth -f grant-favorites-permissions.sql
|
|
--
|
|
-- BEFORE RUNNING: Edit this file and replace 'your_user' with your actual database username
|
|
-- (Check your DATABASE_URL_AUTH environment variable to see which user you're using)
|
|
|
|
-- Connect to the auth database (if not already connected)
|
|
\c punimtag_auth
|
|
|
|
-- Grant permissions on photo_favorites table
|
|
-- Replace 'your_user' with your actual username (e.g., the user from DATABASE_URL_AUTH)
|
|
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE photo_favorites TO your_user;
|
|
|
|
-- Grant usage on sequence (needed for auto-increment IDs)
|
|
GRANT USAGE, SELECT ON SEQUENCE photo_favorites_id_seq TO your_user;
|
|
|
|
\echo '✅ Permissions granted on photo_favorites table!'
|
|
\echo ''
|
|
\echo 'The following permissions were granted:'
|
|
\echo ' - SELECT, INSERT, UPDATE, DELETE on photo_favorites'
|
|
\echo ' - USAGE, SELECT on photo_favorites_id_seq sequence'
|
|
|
|
|
|
|
|
|
|
|
|
|