Sha256: 237850dc402850200793aef4dfc69f5cc8873bdd6884e2ebe10bbb294c160c4e

Contents?: true

Size: 593 Bytes

Versions: 18

Compression:

Stored size: 593 Bytes

Contents

class TrafficOwnerIdsAreSerials < Landable::Migration
  def up
    execute <<-SQL
      SET search_path TO #{Landable.configuration.database_schema_prefix}landable_traffic,public;

      CREATE SEQUENCE owners_owner_id_seq
        START WITH 1
        INCREMENT BY 1
        NO MINVALUE
        NO MAXVALUE
        CACHE 1;

      SELECT setval('owners_owner_id_seq', (SELECT max(owner_id) FROM owners));

      ALTER SEQUENCE owners_owner_id_seq OWNED BY owners.owner_id;

      ALTER TABLE owners ALTER COLUMN owner_id SET DEFAULT nextval('owners_owner_id_seq'::regclass);
    SQL
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
landable-1.14.0 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb
landable-1.13.2 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb
landable-1.13.1 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb
landable-1.12.3 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb
landable-1.12.2 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb
landable-1.12.1 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb
landable-1.11.1 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb
landable-1.11.0 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb
landable-1.10.0.rc2 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb
landable-1.10.0.rc1 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb
landable-1.9.2 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb
landable-1.9.1 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb
landable-1.9.0 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb
landable-1.9.0.rc2 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb
landable-1.9.0.rc1 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb
landable-1.8.0 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb
landable-1.7.1.rc1 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb
landable-1.7.0 db/migrate/20131108212501_traffic_owner_ids_are_serials.rb