Created
October 10, 2010 19:34
-
-
Save solnic/619502 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'dm-core' | |
| require "dm-migrations" | |
| require 'dm-sqlite-adapter' | |
| DataMapper.setup(:default, 'sqlite::memory:') | |
| DataMapper.auto_upgrade! | |
| class Event | |
| include DataMapper::Resource | |
| property :id, Serial | |
| property :signature, Integer | |
| belongs_to :signature, :parent_key => [:sig_id], :child_key => [:signature] | |
| end | |
| class Signature | |
| include DataMapper::Resource | |
| property :sig_id, Serial | |
| has n, :events, :child_key => [:signature] | |
| end | |
| DataMapper.finalize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ~ (0.000047) SELECT sqlite_version(*) | |
| ~ (0.000086) DROP TABLE IF EXISTS "events" | |
| ~ (0.000011) PRAGMA table_info("events") | |
| ~ (0.000231) CREATE TABLE "events" ("id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "signature" INTEGER) | |
| ~ (0.000030) DROP TABLE IF EXISTS "signatures" | |
| ~ (0.000008) PRAGMA table_info("signatures") | |
| ~ (0.000087) CREATE TABLE "signatures" ("sig_id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment