Skip to content

Instantly share code, notes, and snippets.

@elebertus
Created November 17, 2012 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elebertus/4092734 to your computer and use it in GitHub Desktop.
Save elebertus/4092734 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'sqlite3'
db = SQLite3::Database.new( "test.db")
begin
db.query("SELECT * from dashboard_dashboard")
rescue
puts "dashboard_dashboard not found\nCreating table dashboard_dashboard\n"
db.execute("CREATE TABLE \"dashboard_dashboard\" (
\"name\" varchar(128) NOT NULL PRIMARY KEY,
\"state\" text NOT NULL);"
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment