Sha256: 5fee08f14db8b94679863b177b64a32e8374dfe159a643549eb0a797ab5de48d
Contents?: true
Size: 702 Bytes
Versions: 9
Compression:
Stored size: 702 Bytes
Contents
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 ); DROP TABLE IF EXISTS developers; CREATE TABLE developers ( id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255) NOT NULL, salary INTEGER NOT NULL, department VARCHAR(255) NOT NULL, created_at TIMESTAMP NOT NULL ); SQL sql.split(/;/).select(&:present?).each do |sql_statement| ActiveRecord::Base.connection.execute sql_statement end
Version data entries
9 entries across 9 versions & 2 rubygems