2015-06-16 17:23:57 +00:00
|
|
|
ALTER TABLE bands ADD COLUMN band_type VARCHAR(16) DEFAULT '';
|
|
|
|
|
ALTER TABLE bands ADD COLUMN band_status VARCHAR(16) DEFAULT '';
|
VRFS-3242 : Schema and model changes required for band profile functionality.
* Additional attributes for band_type, band_status, concert_count,
add_new_members, play_commitment, touring_option, paid_gigs,
hourly_rate, gig_minimum
* For joined table musician_instruments, remove the hard requirement
that they be joined to a user, rather a “player” that is polymorphic.
* For joined table performance_stamples, remove the hard requirement
that they be joined to a user, rather a “player” that is polymorphic.
* For joined table online_presences, remove the hard requirement that
they be joined to a user, rather a “player” that is polymorphic.
* Change models as appropriate with new attributes and modify
belongs_to / has_many directives as necessary.
* Fix existing usages of user_id to work with polymorphic player_id.
* Fix tests that use user_id
* Add new tests that exercise online_presence, performance_samples, and
instruments that target a band, rather than a user.
2015-05-14 02:06:14 +00:00
|
|
|
ALTER TABLE bands ADD COLUMN concert_count SMALLINT DEFAULT 0;
|
|
|
|
|
ALTER TABLE bands ADD COLUMN add_new_members BOOLEAN DEFAULT FALSE;
|
|
|
|
|
ALTER TABLE bands ADD COLUMN play_commitment SMALLINT DEFAULT 0;
|
|
|
|
|
ALTER TABLE bands ADD COLUMN touring_option BOOLEAN DEFAULT FALSE;
|
|
|
|
|
ALTER TABLE bands ADD COLUMN paid_gigs BOOLEAN DEFAULT FALSE;
|
|
|
|
|
ALTER TABLE bands ADD COLUMN free_gigs BOOLEAN DEFAULT FALSE;
|
|
|
|
|
ALTER TABLE bands ADD COLUMN hourly_rate INT DEFAULT 0;
|
|
|
|
|
ALTER TABLE bands ADD COLUMN gig_minimum INT DEFAULT 0;
|
|
|
|
|
|
|
|
|
|
ALTER TABLE musicians_instruments ALTER COLUMN user_id DROP NOT NULL;
|
|
|
|
|
ALTER TABLE musicians_instruments RENAME COLUMN user_id TO player_id;
|
|
|
|
|
ALTER TABLE musicians_instruments ADD COLUMN player_type VARCHAR(32) DEFAULT 'user';
|
|
|
|
|
ALTER TABLE musicians_instruments DROP CONSTRAINT musicians_instruments_user_id_fkey;
|
|
|
|
|
|
|
|
|
|
ALTER TABLE performance_samples ALTER COLUMN user_id DROP NOT NULL;
|
|
|
|
|
ALTER TABLE performance_samples RENAME COLUMN user_id TO player_id;
|
|
|
|
|
ALTER TABLE performance_samples ADD COLUMN player_type VARCHAR(32) DEFAULT 'user';
|
|
|
|
|
ALTER TABLE performance_samples DROP CONSTRAINT performance_samples_user_id_fkey;
|
|
|
|
|
|
|
|
|
|
ALTER TABLE online_presences ALTER COLUMN user_id DROP NOT NULL;
|
|
|
|
|
ALTER TABLE online_presences RENAME COLUMN user_id TO player_id;
|
|
|
|
|
ALTER TABLE online_presences ADD COLUMN player_type VARCHAR(32) DEFAULT 'user';
|
|
|
|
|
ALTER TABLE online_presences DROP CONSTRAINT online_presences_user_id_fkey;
|