1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/spec/schemas/mysql_schema.rb
Bryan Helmkamp dc7b51883b Whitespace
2009-05-17 16:20:40 -04:00

18 lines
449 B
Ruby

sql = <<-SQL
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL
);
DROP TABLE IF EXISTS photos;
CREATE TABLE photos (
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
user_id INTEGER NOT NULL,
camera_id INTEGER NOT NULL
);
SQL
sql.split(/;/).select(&:present?).each do |sql_statement|
ActiveRecord::Base.connection.execute sql_statement
end