Commit 57d45e87 authored by 神楽坂玲奈's avatar 神楽坂玲奈

settings 初步

git-svn-id: http://glupx.googlecode.com/svn/trunk/Reliz@50 189f022a-1064-8ae2-3e6f-c4a67275c50b
parent eff9a328
class Setting < ActiveRecord::Base
end
class CreateSettings < ActiveRecord::Migration
def self.up
create_table :settings, :primary_key => :name do |t|
t.text :value
end
change_column(:settings, :name, :string)
end
def self.down
drop_table :settings
end
end
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20111036031159) do ActiveRecord::Schema.define(:version => 20111036031160) do
create_table "boards", :force => true do |t| create_table "boards", :force => true do |t|
t.string "name" t.string "name"
...@@ -75,15 +75,20 @@ ActiveRecord::Schema.define(:version => 20111036031159) do ...@@ -75,15 +75,20 @@ ActiveRecord::Schema.define(:version => 20111036031159) do
t.datetime "updated_at" t.datetime "updated_at"
end end
create_table "settings", :primary_key => "name", :force => true do |t|
t.text "value"
end
create_table "topics", :force => true do |t| create_table "topics", :force => true do |t|
t.integer "user_id", :null => false t.integer "user_id", :null => false
t.integer "type_id" t.integer "type_id"
t.integer "category_id", :null => false t.integer "category_id", :null => false
t.string "category_type", :default => "", :null => false t.string "category_type", :default => "", :null => false
t.string "name", :default => "", :null => false t.string "name", :default => "", :null => false
t.boolean "digest", :default => false, :null => false
t.integer "displayorder", :default => 0, :null => false t.integer "displayorder", :default => 0, :null => false
t.integer "highlight", :default => 0, :null => false t.integer "highlight", :default => 0, :null => false
t.integer "views", :default => 0, :null => false t.integer "viewnum", :default => 0, :null => false
t.integer "readperm", :default => 1, :null => false t.integer "readperm", :default => 1, :null => false
t.boolean "locked", :default => false, :null => false t.boolean "locked", :default => false, :null => false
t.boolean "deleted", :default => false, :null => false t.boolean "deleted", :default => false, :null => false
......
...@@ -115040,3 +115040,206 @@ Started GET "/css/ui-lightness/jquery-ui-1.8.11.custom.css" for 127.0.0.1 at 201 ...@@ -115040,3 +115040,206 @@ Started GET "/css/ui-lightness/jquery-ui-1.8.11.custom.css" for 127.0.0.1 at 201
User Load (15.6ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 0) LIMIT 1 User Load (15.6ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 0) LIMIT 1
Redirected to http://www.touhou.cc/bbs/css/ui-lightness/jquery-ui-1.8.11.custom.css? Redirected to http://www.touhou.cc/bbs/css/ui-lightness/jquery-ui-1.8.11.custom.css?
Completed 302 Found in 125ms Completed 302 Found in 125ms
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`
Migrating to CreateTopics (20101226015150)
Migrating to CreatePosts (20101226015930)
Migrating to CreateComments (20101226021619)
Migrating to CreatePms (20101226032430)
Migrating to CreateNotices (20101226033857)
Migrating to CreateBoards (20101226072024)
Migrating to CreateModerations (20101226125042)
Migrating to CreateUsers (20111036031159)
Migrating to CreateSettings (20111036031160)
SQL (15.6ms) CREATE TABLE `settings` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `value` text, `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB
Mysql::Error: Incorrect table definition; there can be only one auto column and it must be defined as a key: CREATE TABLE `settings` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `value` text, `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`
Migrating to CreateTopics (20101226015150)
Migrating to CreatePosts (20101226015930)
Migrating to CreateComments (20101226021619)
Migrating to CreatePms (20101226032430)
Migrating to CreateNotices (20101226033857)
Migrating to CreateBoards (20101226072024)
Migrating to CreateModerations (20101226125042)
Migrating to CreateUsers (20111036031159)
Migrating to CreateSettings (20111036031160)
SQL (93.8ms) CREATE TABLE `settings` (`name` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `value` text, `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB
SQL (31.2ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20111036031160')
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) describe `boards`
SQL (15.6ms) SHOW KEYS FROM `boards`
SQL (15.6ms) describe `comments`
SQL (15.6ms) SHOW KEYS FROM `comments`
SQL (15.6ms) describe `moderations`
SQL (15.6ms) SHOW KEYS FROM `moderations`
SQL (15.6ms) describe `notices`
SQL (15.6ms) SHOW KEYS FROM `notices`
SQL (31.2ms) describe `pms`
SQL (15.6ms) SHOW KEYS FROM `pms`
SQL (15.6ms) describe `posts`
SQL (15.6ms) SHOW KEYS FROM `posts`
SQL (15.6ms) describe `settings`
SQL (31.2ms) SHOW KEYS FROM `settings`
SQL (15.6ms) describe `topics`
SQL (15.6ms) SHOW KEYS FROM `topics`
SQL (15.6ms) describe `users`
SQL (15.6ms) SHOW KEYS FROM `users`
SQL (31.2ms) SHOW TABLES
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`
Migrating to CreateTopics (20101226015150)
Migrating to CreatePosts (20101226015930)
Migrating to CreateComments (20101226021619)
Migrating to CreatePms (20101226032430)
Migrating to CreateNotices (20101226033857)
Migrating to CreateBoards (20101226072024)
Migrating to CreateModerations (20101226125042)
Migrating to CreateUsers (20111036031159)
Migrating to CreateSettings (20111036031160)
SQL (843.8ms) CREATE TABLE `settings` (`name` varchar(255), `value` text) ENGINE=InnoDB
SQL (140.6ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20111036031160')
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`
SQL (15.6ms) SHOW TABLES
SQL (31.2ms) describe `boards`
SQL (15.6ms) SHOW KEYS FROM `boards`
SQL (15.6ms) describe `comments`
SQL (15.6ms) SHOW KEYS FROM `comments`
SQL (31.2ms) describe `moderations`
SQL (15.6ms) SHOW KEYS FROM `moderations`
SQL (15.6ms) describe `notices`
SQL (15.6ms) SHOW KEYS FROM `notices`
SQL (15.6ms) describe `pms`
SQL (15.6ms) SHOW KEYS FROM `pms`
SQL (15.6ms) describe `posts`
SQL (15.6ms) SHOW KEYS FROM `posts`
SQL (15.6ms) describe `settings`
SQL (15.6ms) SHOW KEYS FROM `settings`
SQL (31.2ms) describe `topics`
SQL (15.6ms) SHOW KEYS FROM `topics`
SQL (15.6ms) describe `users`
SQL (15.6ms) SHOW KEYS FROM `users`
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`
Migrating to CreateTopics (20101226015150)
Migrating to CreatePosts (20101226015930)
Migrating to CreateComments (20101226021619)
Migrating to CreatePms (20101226032430)
Migrating to CreateNotices (20101226033857)
Migrating to CreateBoards (20101226072024)
Migrating to CreateModerations (20101226125042)
Migrating to CreateUsers (20111036031159)
Migrating to CreateSettings (20111036031160)
SQL (609.4ms) CREATE TABLE `settings` (`name` varchar(255), `value` text) ENGINE=InnoDB
SQL (125.0ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20111036031160')
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) describe `boards`
SQL (15.6ms) SHOW KEYS FROM `boards`
SQL (31.2ms) describe `comments`
SQL (15.6ms) SHOW KEYS FROM `comments`
SQL (31.2ms) describe `moderations`
SQL (15.6ms) SHOW KEYS FROM `moderations`
SQL (15.6ms) describe `notices`
SQL (15.6ms) SHOW KEYS FROM `notices`
SQL (31.2ms) describe `pms`
SQL (15.6ms) SHOW KEYS FROM `pms`
SQL (15.6ms) describe `posts`
SQL (15.6ms) SHOW KEYS FROM `posts`
SQL (15.6ms) describe `settings`
SQL (15.6ms) SHOW KEYS FROM `settings`
SQL (31.2ms) describe `topics`
SQL (15.6ms) SHOW KEYS FROM `topics`
SQL (15.6ms) describe `users`
SQL (15.6ms) SHOW KEYS FROM `users`
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`
Migrating to CreateTopics (20101226015150)
Migrating to CreatePosts (20101226015930)
Migrating to CreateComments (20101226021619)
Migrating to CreatePms (20101226032430)
Migrating to CreateNotices (20101226033857)
Migrating to CreateBoards (20101226072024)
Migrating to CreateModerations (20101226125042)
Migrating to CreateUsers (20111036031159)
Migrating to CreateSettings (20111036031160)
SQL (93.8ms) CREATE TABLE `settings` (`name` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `value` text) ENGINE=InnoDB
SQL (171.9ms) ALTER TABLE `settings` CHANGE `name` `name` varchar(255) NOT NULL
SQL (31.2ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20111036031160')
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`
SQL (15.6ms) SHOW TABLES
SQL (31.2ms) describe `boards`
SQL (15.6ms) SHOW KEYS FROM `boards`
SQL (15.6ms) describe `comments`
SQL (15.6ms) SHOW KEYS FROM `comments`
SQL (31.2ms) describe `moderations`
SQL (15.6ms) SHOW KEYS FROM `moderations`
SQL (15.6ms) describe `notices`
SQL (15.6ms) SHOW KEYS FROM `notices`
SQL (15.6ms) describe `pms`
SQL (15.6ms) SHOW KEYS FROM `pms`
SQL (15.6ms) describe `posts`
SQL (15.6ms) SHOW KEYS FROM `posts`
SQL (15.6ms) describe `settings`
SQL (31.2ms) SHOW KEYS FROM `settings`
SQL (15.6ms) describe `topics`
SQL (15.6ms) SHOW KEYS FROM `topics`
SQL (15.6ms) describe `users`
SQL (15.6ms) SHOW KEYS FROM `users`
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`
Migrating to CreateTopics (20101226015150)
Migrating to CreatePosts (20101226015930)
Migrating to CreateComments (20101226021619)
Migrating to CreatePms (20101226032430)
Migrating to CreateNotices (20101226033857)
Migrating to CreateBoards (20101226072024)
Migrating to CreateModerations (20101226125042)
Migrating to CreateUsers (20111036031159)
Migrating to CreateSettings (20111036031160)
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`
Migrating to CreateTopics (20101226015150)
Migrating to CreatePosts (20101226015930)
Migrating to CreateComments (20101226021619)
Migrating to CreatePms (20101226032430)
Migrating to CreateNotices (20101226033857)
Migrating to CreateBoards (20101226072024)
Migrating to CreateModerations (20101226125042)
Migrating to CreateUsers (20111036031159)
Migrating to CreateSettings (20111036031160)
SQL (109.4ms) CREATE TABLE `settings` (`name` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `value` text) ENGINE=InnoDB
SQL (171.9ms) ALTER TABLE `settings` CHANGE `name` `name` varchar(255) NOT NULL
SQL (46.9ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20111036031160')
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`
SQL (15.6ms) SHOW TABLES
SQL (15.6ms) describe `boards`
SQL (15.6ms) SHOW KEYS FROM `boards`
SQL (31.2ms) describe `comments`
SQL (15.6ms) SHOW KEYS FROM `comments`
SQL (15.6ms) describe `moderations`
SQL (15.6ms) SHOW KEYS FROM `moderations`
SQL (31.2ms) describe `notices`
SQL (15.6ms) SHOW KEYS FROM `notices`
SQL (15.6ms) describe `pms`
SQL (15.6ms) SHOW KEYS FROM `pms`
SQL (15.6ms) describe `posts`
SQL (15.6ms) SHOW KEYS FROM `posts`
SQL (31.2ms) describe `settings`
SQL (15.6ms) SHOW KEYS FROM `settings`
SQL (15.6ms) describe `topics`
SQL (15.6ms) SHOW KEYS FROM `topics`
SQL (15.6ms) describe `users`
SQL (15.6ms) SHOW KEYS FROM `users`
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
one:
name:
value: MyText
two:
name:
value: MyText
require 'test_helper'
class SettingTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment