Sha256: 08bfea104128525b647134ff854870ac97cb262c1a01f25c38aabf42be0bb8a1

Contents?: true

Size: 645 Bytes

Versions: 16

Compression:

Stored size: 645 Bytes

Contents

require 'sequel'

if !File.size?('vmail.db')
  create_table_script = File.expand_path("../../../db/create.sql", __FILE__)
  puts `sqlite3 vmail.db < #{create_table_script}`
end

DB = Sequel.connect 'sqlite://vmail.db'

if DB[:version].count == 0
  DB[:version].insert(:vmail_version => Vmail::VERSION)
end

class Vmail::Message < Sequel::Model
  set_primary_key :message_id
  one_to_many :labelings
  many_to_many :labels, :join_table => 'labelings'
end

class Vmail::Label < Sequel::Model
  set_primary_key :label_id
  one_to_many :labelings
  many_to_many :messages, :join_table => 'labelings'
end

class Vmail::Labeling < Sequel::Model
end


Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
vmail-1.8.6 lib/vmail/database.rb
vmail-1.8.5 lib/vmail/database.rb
vmail-1.8.4 lib/vmail/database.rb
vmail-1.8.3 lib/vmail/database.rb
vmail-1.8.2 lib/vmail/database.rb
vmail-1.8.1 lib/vmail/database.rb
vmail-1.8.0 lib/vmail/database.rb
vmail-1.7.9 lib/vmail/database.rb
vmail-1.7.8 lib/vmail/database.rb
vmail-1.7.7 lib/vmail/database.rb
vmail-1.7.6 lib/vmail/database.rb
vmail-1.7.5 lib/vmail/database.rb
vmail-1.7.4 lib/vmail/database.rb
vmail-1.7.3 lib/vmail/database.rb
vmail-1.7.2 lib/vmail/database.rb
vmail-1.7.1 lib/vmail/database.rb