Skip to content

Commit

Permalink
use sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
maccman committed Apr 5, 2011
1 parent c2fb188 commit 9e4554c
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 53 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -8,7 +8,7 @@ gem "rack-sprockets"
gem "yui-compressor"
gem "supermodel"

gem "mysql2"
gem "sqlite3"
gem "juggernaut"
gem "thin"

Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Expand Up @@ -65,7 +65,6 @@ GEM
multi_json (0.0.5)
multipart-post (1.1.0)
mutter (0.5.3)
mysql2 (0.2.6)
net-ldap (0.1.1)
nokogiri (1.4.4)
oa-basic (0.2.0)
Expand Down Expand Up @@ -154,6 +153,7 @@ GEM
archive-tar-minitar (>= 0.5.2)
rubyntlm (0.1.1)
sprockets (1.0.2)
sqlite3 (1.3.3)
supermodel (0.1.4)
activemodel (>= 3.0.0.beta)
thin (1.2.11)
Expand All @@ -173,12 +173,12 @@ DEPENDENCIES
carrierwave
juggernaut
less!
mysql2
omniauth
rack-less
rack-sprockets
rails (= 3.0.5)
ruby-debug19
sqlite3
supermodel
thin
yui-compressor
3 changes: 1 addition & 2 deletions README.md
Expand Up @@ -23,8 +23,7 @@ Good examples for:
# Installation

* bundle install
* rake db:create
* cat db/development_structure.sql | rails dbconsole
* rake db:migrate
* rails server thin
* start the Juggernaut server - [http://github.com/maccman/juggernaut](http://github.com/maccman/juggernaut)

Expand Down
2 changes: 1 addition & 1 deletion app/models/channel.rb
@@ -1,7 +1,7 @@
class Channel < ActiveRecord::Base
has_many :messages, :dependent => :destroy

include ActiveRecord::GUID
# include ActiveRecord::GUID

attr_accessible :id, :name
end
4 changes: 1 addition & 3 deletions app/models/message.rb
Expand Up @@ -5,7 +5,5 @@ class Message < ActiveRecord::Base

attr_accessible :id, :body, :name, :channel_id

include ActiveRecord::GUID

attr_accessor :per
# include ActiveRecord::GUID
end
23 changes: 11 additions & 12 deletions config/database.yml
@@ -1,23 +1,22 @@
# SQLite version 3.x
# gem install sqlite3
development:
adapter: mysql2
database: holla2_development
username: root
password:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql2
database: holla2_test
username: root
password:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000

production:
adapter: mysql2
database: holla2_production
username: root
password:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
2 changes: 2 additions & 0 deletions db/migrate/20110324051348_create_messages.rb
Expand Up @@ -2,6 +2,8 @@ class CreateMessages < ActiveRecord::Migration
def self.up
create_table :messages, :force => true do |t|
t.text :body
t.string :channel_id
t.string :name
t.timestamps
end
end
Expand Down
9 changes: 0 additions & 9 deletions db/migrate/20110325211741_add_channel_id_to_messages.rb

This file was deleted.

9 changes: 0 additions & 9 deletions db/migrate/20110326065302_add_name_to_messages.rb

This file was deleted.

20 changes: 6 additions & 14 deletions db/schema.rb
Expand Up @@ -10,30 +10,22 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20110326213742) do
ActiveRecord::Schema.define(:version => 20110325083934) do

create_table "channels", :force => true do |t|
create_table "channels", :id => false, :force => true do |t|
t.string "id"
t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
end

create_table "messages", :force => true do |t|
create_table "messages", :id => false, :force => true do |t|
t.string "id"
t.text "body"
t.datetime "created_at"
t.datetime "updated_at"
t.string "channel_id", :null => false
t.string "channel_id"
t.string "name"
end

create_table "sessions", :force => true do |t|
t.string "session_id", :null => false
t.text "data"
t.datetime "created_at"
t.datetime "updated_at"
end

add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"

end

0 comments on commit 9e4554c

Please sign in to comment.