diff options
Diffstat (limited to 'spec/schemas/sqlite3_schema.rb')
-rw-r--r-- | spec/schemas/sqlite3_schema.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/schemas/sqlite3_schema.rb b/spec/schemas/sqlite3_schema.rb new file mode 100644 index 0000000000..6c98a4f934 --- /dev/null +++ b/spec/schemas/sqlite3_schema.rb @@ -0,0 +1,18 @@ +sql = <<-SQL + DROP TABLE IF EXISTS users; + CREATE TABLE users ( + id INTEGER NOT NULL PRIMARY KEY, + name VARCHAR(255) NOT NULL + ); + + DROP TABLE IF EXISTS photos; + CREATE TABLE photos ( + id INTEGER NOT NULL 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
\ No newline at end of file |