- Updated league handling to ensure valid page size checks and improved error handling for sport ID parsing. - Introduced new endpoint to update global league settings with comprehensive validation and error logging. - Refactored odds settings management, including saving, removing, and updating odds settings with enhanced validation. - Added tenant slug retrieval by token, ensuring proper user and company validation. - Improved middleware to check for active company status and adjusted route permissions for various endpoints. - Added SQL script to fix auto-increment desynchronization across multiple tables.
31 lines
761 B
SQL
31 lines
761 B
SQL
-- For each table with an id sequence
|
|
SELECT setval(
|
|
pg_get_serial_sequence('users', 'id'),
|
|
COALESCE(MAX(id), 1)
|
|
)
|
|
FROM users;
|
|
SELECT setval(
|
|
pg_get_serial_sequence('wallets', 'id'),
|
|
COALESCE(MAX(id), 1)
|
|
)
|
|
FROM wallets;
|
|
SELECT setval(
|
|
pg_get_serial_sequence('customer_wallets', 'id'),
|
|
COALESCE(MAX(id), 1)
|
|
)
|
|
FROM customer_wallets;
|
|
SELECT setval(
|
|
pg_get_serial_sequence('companies', 'id'),
|
|
COALESCE(MAX(id), 1)
|
|
)
|
|
FROM companies;
|
|
SELECT setval(
|
|
pg_get_serial_sequence('branches', 'id'),
|
|
COALESCE(MAX(id), 1)
|
|
)
|
|
FROM branches;
|
|
SELECT setval(
|
|
pg_get_serial_sequence('supported_operations', 'id'),
|
|
COALESCE(MAX(id), 1)
|
|
)
|
|
FROM supported_operations; |