Skip to content

Instantly share code, notes, and snippets.

@breandan
Created October 19, 2012 23:19
Show Gist options
  • Save breandan/3921254 to your computer and use it in GitHub Desktop.
Save breandan/3921254 to your computer and use it in GitHub Desktop.
CreateSpendEstimates
class CreateSpendEstimates < ActiveRecord::Migration
def up
execute <<-_SQL
CREATE TABLE `anbidder_spend_estimates` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`destination_group_id` int(11),
`expires_at` TIMESTAMP NULL,
`amount` decimal(15,10) DEFAULT NULL,
`bidder_id` SMALLINT NOT NULL,
`description` varchar(255),
PRIMARY KEY (`id`),
CONSTRAINT `spend_est_dg_fk` FOREIGN KEY (`destination_group_id`) REFERENCES `destination_groups` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
_SQL
end
def down
drop_table :anbidder_spend_estimates
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment