You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
646 B
19 lines
646 B
USE dating_app;
|
|
|
|
-- Existing profiles remain nullable for backward compatibility. New email/phone
|
|
-- registrations require one of the four values at the API validation layer.
|
|
SET @column_exists = (
|
|
SELECT COUNT(*)
|
|
FROM information_schema.columns
|
|
WHERE table_schema = DATABASE()
|
|
AND table_name = 'user_profiles'
|
|
AND column_name = 'relationship_goal'
|
|
);
|
|
SET @statement = IF(
|
|
@column_exists = 0,
|
|
'ALTER TABLE user_profiles ADD COLUMN relationship_goal VARCHAR(30) NULL AFTER country',
|
|
'SELECT 1'
|
|
);
|
|
PREPARE migration_statement FROM @statement;
|
|
EXECUTE migration_statement;
|
|
DEALLOCATE PREPARE migration_statement;
|
|
|