Skip to content
Browse files

use sqlite

  • Loading branch information...
1 parent c2fb188 commit 9e4554c4bb8a636cf2de7eb614998eeeab51b006 @maccman committed Apr 5, 2011
View
2 Gemfile
@@ -8,7 +8,7 @@ gem "rack-sprockets"
gem "yui-compressor"
gem "supermodel"
-gem "mysql2"
+gem "sqlite3"
gem "juggernaut"
gem "thin"
View
4 Gemfile.lock
@@ -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)
@@ -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)
@@ -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
View
3 README.md
@@ -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)
View
2 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
View
4 app/models/message.rb
@@ -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
View
23 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
View
2 db/migrate/20110324051348_create_messages.rb
@@ -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
View
9 db/migrate/20110325211741_add_channel_id_to_messages.rb
@@ -1,9 +0,0 @@
-class AddChannelIdToMessages < ActiveRecord::Migration
- def self.up
- add_column :messages, :channel_id, :string, :null => false
- end
-
- def self.down
- remove_column :messages, :channel_id
- end
-end
View
9 db/migrate/20110326065302_add_name_to_messages.rb
@@ -1,9 +0,0 @@
-class AddNameToMessages < ActiveRecord::Migration
- def self.up
- add_column :messages, :name, :string
- end
-
- def self.down
- remove_column :messages, :name
- end
-end
View
20 db/schema.rb
@@ -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.
Something went wrong with that request. Please try again.