weixin_pam 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +165 -0
  4. data/Rakefile +37 -0
  5. data/app/assets/javascripts/jquery-sortable.js +699 -0
  6. data/app/assets/javascripts/weixin_pam/application.js +30 -0
  7. data/app/assets/javascripts/weixin_pam/diymenus.js +90 -0
  8. data/app/assets/javascripts/weixin_pam/public_accounts.js +2 -0
  9. data/app/assets/javascripts/weixin_pam/user_accounts.js +23 -0
  10. data/app/assets/stylesheets/weixin_pam/application.scss +31 -0
  11. data/app/assets/stylesheets/weixin_pam/diymenus.scss +52 -0
  12. data/app/assets/stylesheets/weixin_pam/jquery-dragable.scss +26 -0
  13. data/app/assets/stylesheets/weixin_pam/public_accounts.css +4 -0
  14. data/app/assets/stylesheets/weixin_pam/user_accounts.css +4 -0
  15. data/app/controllers/weixin_pam/application_controller.rb +4 -0
  16. data/app/controllers/weixin_pam/diymenus_controller.rb +100 -0
  17. data/app/controllers/weixin_pam/public_accounts_controller.rb +62 -0
  18. data/app/controllers/weixin_pam/user_accounts_controller.rb +76 -0
  19. data/app/decorators/controllers/weixin_rails_middleware/weixin_controller_decorator.rb +31 -0
  20. data/app/helpers/weixin_pam/application_helper.rb +18 -0
  21. data/app/helpers/weixin_pam/diymenus_helper.rb +4 -0
  22. data/app/helpers/weixin_pam/public_accounts_helper.rb +4 -0
  23. data/app/helpers/weixin_pam/user_accounts_helper.rb +4 -0
  24. data/app/models/weixin_pam/diymenu.rb +58 -0
  25. data/app/models/weixin_pam/public_account.rb +87 -0
  26. data/app/models/weixin_pam/user_account.rb +67 -0
  27. data/app/views/layouts/weixin_pam/_nav_bar.html.erb +37 -0
  28. data/app/views/layouts/weixin_pam/application.html.erb +26 -0
  29. data/app/views/weixin_pam/diymenus/_form.html.erb +18 -0
  30. data/app/views/weixin_pam/diymenus/edit.html.erb +3 -0
  31. data/app/views/weixin_pam/diymenus/index.html.slim +32 -0
  32. data/app/views/weixin_pam/diymenus/new.html.erb +3 -0
  33. data/app/views/weixin_pam/public_accounts/_form.html.erb +12 -0
  34. data/app/views/weixin_pam/public_accounts/edit.html.erb +3 -0
  35. data/app/views/weixin_pam/public_accounts/index.html.erb +30 -0
  36. data/app/views/weixin_pam/public_accounts/new.html.erb +3 -0
  37. data/app/views/weixin_pam/public_accounts/show.html.erb +17 -0
  38. data/app/views/weixin_pam/user_accounts/_form.html.erb +37 -0
  39. data/app/views/weixin_pam/user_accounts/edit.html.erb +6 -0
  40. data/app/views/weixin_pam/user_accounts/index.html.slim +25 -0
  41. data/app/views/weixin_pam/user_accounts/new.html.erb +5 -0
  42. data/app/views/weixin_pam/user_accounts/show.html.erb +29 -0
  43. data/config/initializers/simple_form.rb +165 -0
  44. data/config/initializers/simple_form_bootstrap.rb +149 -0
  45. data/config/initializers/weixin_rails_middleware.rb +27 -0
  46. data/config/locales/diymenu.zh-CN.yml +9 -0
  47. data/config/locales/public_account.zh-CN.yml +16 -0
  48. data/config/locales/simple_form.en.yml +31 -0
  49. data/config/locales/user_account.zh-CN.yml +13 -0
  50. data/config/routes.rb +17 -0
  51. data/db/migrate/20151211153307_create_weixin_pam_public_accounts.rb +14 -0
  52. data/db/migrate/20151211153353_create_weixin_pam_user_accounts.rb +19 -0
  53. data/db/migrate/20151212152624_create_weixin_pam_diymenus.rb +18 -0
  54. data/db/migrate/20151215140830_add_weixin_secret_key_and_weixin_token_to_public_accounts.rb +13 -0
  55. data/db/migrate/20151218053505_add_host_to_weixin_pam_public_account.rb +6 -0
  56. data/lib/tasks/weixin_pam_tasks.rake +4 -0
  57. data/lib/templates/erb/scaffold/_form.html.erb +13 -0
  58. data/lib/weixin_pam.rb +3 -0
  59. data/lib/weixin_pam/api_error.rb +3 -0
  60. data/lib/weixin_pam/api_error/failed_result.rb +11 -0
  61. data/lib/weixin_pam/engine.rb +24 -0
  62. data/lib/weixin_pam/public_account_reply.rb +222 -0
  63. data/lib/weixin_pam/version.rb +3 -0
  64. data/test/controllers/weixin_pam/diymenus_controller_test.rb +52 -0
  65. data/test/controllers/weixin_pam/public_accounts_controller_test.rb +52 -0
  66. data/test/controllers/weixin_pam/user_accounts_controller_test.rb +52 -0
  67. data/test/dummy/README.rdoc +28 -0
  68. data/test/dummy/Rakefile +6 -0
  69. data/test/dummy/app/assets/javascripts/application.js +13 -0
  70. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  71. data/test/dummy/app/controllers/application_controller.rb +5 -0
  72. data/test/dummy/app/helpers/application_helper.rb +2 -0
  73. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  74. data/test/dummy/bin/bundle +3 -0
  75. data/test/dummy/bin/rails +4 -0
  76. data/test/dummy/bin/rake +4 -0
  77. data/test/dummy/bin/setup +29 -0
  78. data/test/dummy/config.ru +4 -0
  79. data/test/dummy/config/application.rb +26 -0
  80. data/test/dummy/config/boot.rb +5 -0
  81. data/test/dummy/config/database.yml +25 -0
  82. data/test/dummy/config/environment.rb +5 -0
  83. data/test/dummy/config/environments/development.rb +41 -0
  84. data/test/dummy/config/environments/production.rb +79 -0
  85. data/test/dummy/config/environments/test.rb +42 -0
  86. data/test/dummy/config/initializers/assets.rb +11 -0
  87. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  88. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  89. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  90. data/test/dummy/config/initializers/inflections.rb +16 -0
  91. data/test/dummy/config/initializers/mime_types.rb +4 -0
  92. data/test/dummy/config/initializers/session_store.rb +3 -0
  93. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  94. data/test/dummy/config/locales/en.yml +23 -0
  95. data/test/dummy/config/routes.rb +4 -0
  96. data/test/dummy/config/secrets.yml +22 -0
  97. data/test/dummy/db/development.sqlite3 +0 -0
  98. data/test/dummy/db/schema.rb +60 -0
  99. data/test/dummy/db/test.sqlite3 +0 -0
  100. data/test/dummy/log/development.log +594 -0
  101. data/test/dummy/public/404.html +67 -0
  102. data/test/dummy/public/422.html +67 -0
  103. data/test/dummy/public/500.html +66 -0
  104. data/test/dummy/public/favicon.ico +0 -0
  105. data/test/fixtures/weixin_pam/diymenus.yml +19 -0
  106. data/test/fixtures/weixin_pam/public_accounts.yml +17 -0
  107. data/test/fixtures/weixin_pam/user_accounts.yml +15 -0
  108. data/test/integration/navigation_test.rb +8 -0
  109. data/test/models/weixin_pam/diymenu_test.rb +9 -0
  110. data/test/models/weixin_pam/public_account_test.rb +9 -0
  111. data/test/models/weixin_pam/user_account_test.rb +9 -0
  112. data/test/test_helper.rb +21 -0
  113. data/test/weixin_pam_test.rb +7 -0
  114. metadata +374 -0
@@ -0,0 +1,42 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static file server for tests with Cache-Control for performance.
16
+ config.serve_static_files = true
17
+ config.static_cache_control = 'public, max-age=3600'
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Randomize the order test cases are executed.
35
+ config.active_support.test_order = :random
36
+
37
+ # Print deprecation notices to the stderr.
38
+ config.active_support.deprecation = :stderr
39
+
40
+ # Raises error for missing translations
41
+ # config.action_view.raise_on_missing_translations = true
42
+ end
@@ -0,0 +1,11 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Add additional assets to the asset load path
7
+ # Rails.application.config.assets.paths << Emoji.images_path
8
+
9
+ # Precompile additional assets.
10
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,4 @@
1
+ Rails.application.routes.draw do
2
+
3
+ mount WeixinPam::Engine => "/weixin_pam"
4
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: 42e7055f8d4abde21c6d79d571b1e02e386fb8188d0ba1b63e7342403d0f9ec38980288b16884582a6f6bb6bde17ee457fae1e28b95b4ad3b6a5040eda8719d3
15
+
16
+ test:
17
+ secret_key_base: b91d31af61fe2198a6afbf32573df9252ceb351f828e58753b6333a5ea4be78cc4f5fce3dc12670ad774d4b3935e83da4af51ef5cba261994341558427a3abe4
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,60 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20151215140830) do
15
+
16
+ create_table "weixin_pam_diymenus", force: :cascade do |t|
17
+ t.integer "public_account_id"
18
+ t.integer "parent_id"
19
+ t.string "name"
20
+ t.string "key"
21
+ t.string "url"
22
+ t.boolean "is_show"
23
+ t.integer "sort"
24
+ t.datetime "created_at", null: false
25
+ t.datetime "updated_at", null: false
26
+ end
27
+
28
+ add_index "weixin_pam_diymenus", ["parent_id"], name: "index_weixin_pam_diymenus_on_parent_id"
29
+ add_index "weixin_pam_diymenus", ["public_account_id"], name: "index_weixin_pam_diymenus_on_public_account_id"
30
+
31
+ create_table "weixin_pam_public_accounts", force: :cascade do |t|
32
+ t.string "name"
33
+ t.string "app_id"
34
+ t.string "app_secret"
35
+ t.string "api_url"
36
+ t.string "api_token"
37
+ t.boolean "enabled"
38
+ t.datetime "created_at", null: false
39
+ t.datetime "updated_at", null: false
40
+ t.string "weixin_secret_key"
41
+ t.string "weixin_token"
42
+ end
43
+
44
+ add_index "weixin_pam_public_accounts", ["weixin_secret_key"], name: "index_weixin_pam_public_accounts_on_weixin_secret_key"
45
+ add_index "weixin_pam_public_accounts", ["weixin_token"], name: "index_weixin_pam_public_accounts_on_weixin_token"
46
+
47
+ create_table "weixin_pam_user_accounts", force: :cascade do |t|
48
+ t.integer "public_account_id"
49
+ t.string "uid"
50
+ t.string "nickname"
51
+ t.string "headshot"
52
+ t.boolean "subscribed"
53
+ t.datetime "created_at", null: false
54
+ t.datetime "updated_at", null: false
55
+ end
56
+
57
+ add_index "weixin_pam_user_accounts", ["public_account_id", "uid"], name: "index_weixin_pam_user_accounts_on_public_account_id_and_uid", unique: true
58
+ add_index "weixin_pam_user_accounts", ["public_account_id"], name: "index_weixin_pam_user_accounts_on_public_account_id"
59
+
60
+ end
File without changes
@@ -0,0 +1,594 @@
1
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.1ms) select sqlite_version(*)
3
+  (0.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ Migrating to CreateWeixinPamPublicAccounts (20151211153307)
6
+  (0.1ms) begin transaction
7
+  (0.4ms) CREATE TABLE "weixin_pam_public_accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "app_id" varchar, "app_secret" varchar, "api_url" varchar, "api_token" varchar, "enabled" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
8
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20151211153307"]]
9
+  (0.6ms) commit transaction
10
+ Migrating to CreateWeixinPamUserAccounts (20151211153353)
11
+  (0.0ms) begin transaction
12
+  (0.2ms) CREATE TABLE "weixin_pam_user_accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "public_account_id" integer, "uid" varchar, "nickname" varchar, "headshot" varchar, "subscribed" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
13
+  (0.1ms) CREATE INDEX "index_weixin_pam_user_accounts_on_public_account_id" ON "weixin_pam_user_accounts" ("public_account_id")
14
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20151211153353"]]
15
+  (0.5ms) commit transaction
16
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
17
+  (0.1ms)  SELECT sql
18
+ FROM sqlite_master
19
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
20
+ UNION ALL
21
+ SELECT sql
22
+ FROM sqlite_temp_master
23
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
24
+ 
25
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
26
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
27
+  (0.1ms)  SELECT sql
28
+ FROM sqlite_master
29
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
30
+ UNION ALL
31
+ SELECT sql
32
+ FROM sqlite_temp_master
33
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
34
+ 
35
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
36
+  (0.1ms) SELECT sql
37
+ FROM sqlite_master
38
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
39
+ UNION ALL
40
+ SELECT sql
41
+ FROM sqlite_temp_master
42
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
43
+
44
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
45
+  (0.1ms) SELECT sql
46
+ FROM sqlite_master
47
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
48
+ UNION ALL
49
+ SELECT sql
50
+ FROM sqlite_temp_master
51
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
52
+
53
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
54
+  (0.1ms) SELECT sql
55
+ FROM sqlite_master
56
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
57
+ UNION ALL
58
+ SELECT sql
59
+ FROM sqlite_temp_master
60
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
61
+
62
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
63
+  (0.1ms) SELECT sql
64
+ FROM sqlite_master
65
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
66
+ UNION ALL
67
+ SELECT sql
68
+ FROM sqlite_temp_master
69
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
70
+
71
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
72
+  (0.1ms) SELECT sql
73
+ FROM sqlite_master
74
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
75
+ UNION ALL
76
+ SELECT sql
77
+ FROM sqlite_temp_master
78
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
79
+
80
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
81
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
82
+ Migrating to CreateWeixinPamUserAccounts (20151211153353)
83
+  (0.1ms) begin transaction
84
+  (0.4ms) DROP TABLE "weixin_pam_user_accounts"
85
+ SQL (0.2ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = ? [["version", "20151211153353"]]
86
+  (0.5ms) commit transaction
87
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
88
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
89
+ Migrating to CreateWeixinPamUserAccounts (20151211153353)
90
+  (0.0ms) begin transaction
91
+  (0.2ms) CREATE TABLE "weixin_pam_user_accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "weixin_pam_public_account_id" integer, "uid" varchar, "nickname" varchar, "headshot" varchar, "subscribed" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
92
+  (0.0ms) select sqlite_version(*)
93
+  (0.1ms) CREATE INDEX "index_weixin_pam_user_accounts_on_weixin_pam_public_account_id" ON "weixin_pam_user_accounts" ("weixin_pam_public_account_id")
94
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20151211153353"]]
95
+  (0.6ms) commit transaction
96
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
97
+  (0.1ms) SELECT sql
98
+ FROM sqlite_master
99
+ WHERE name='index_weixin_pam_user_accounts_on_weixin_pam_public_account_id' AND type='index'
100
+ UNION ALL
101
+ SELECT sql
102
+ FROM sqlite_temp_master
103
+ WHERE name='index_weixin_pam_user_accounts_on_weixin_pam_public_account_id' AND type='index'
104
+
105
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
106
+ Migrating to CreateWeixinPamDiymenus (20151212150808)
107
+  (0.1ms) begin transaction
108
+  (0.4ms) CREATE TABLE "weixin_pam_diymenus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "public_account_id" integer, "parent_id" integer, "name" varchar, "key" varchar, "url" varchar, "is_show" boolean, "sort" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
109
+  (0.3ms) select sqlite_version(*)
110
+  (0.1ms) CREATE INDEX "index_weixin_pam_diymenus_on_public_account_id" ON "weixin_pam_diymenus" ("public_account_id")
111
+  (0.1ms) SELECT sql
112
+ FROM sqlite_master
113
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
114
+ UNION ALL
115
+ SELECT sql
116
+ FROM sqlite_temp_master
117
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
118
+
119
+  (0.1ms) CREATE INDEX "index_weixin_pam_diymenus_on_parent_id" ON "weixin_pam_diymenus" ("parent_id")
120
+  (0.1ms) CREATE INDEX "index_diymenus_on_key" ON "diymenus" ("key")
121
+  (0.3ms) rollback transaction
122
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
123
+ Migrating to CreateWeixinPamDiymenus (20151212150808)
124
+  (0.1ms) begin transaction
125
+  (0.4ms) CREATE TABLE "weixin_pam_diymenus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "public_account_id" integer, "parent_id" integer, "name" varchar, "key" varchar, "url" varchar, "is_show" boolean, "sort" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
126
+  (0.0ms) select sqlite_version(*)
127
+  (0.1ms) CREATE INDEX "index_weixin_pam_diymenus_on_public_account_id" ON "weixin_pam_diymenus" ("public_account_id")
128
+  (0.1ms) SELECT sql
129
+ FROM sqlite_master
130
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
131
+ UNION ALL
132
+ SELECT sql
133
+ FROM sqlite_temp_master
134
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
135
+
136
+  (0.1ms) CREATE INDEX "index_weixin_pam_diymenus_on_parent_id" ON "weixin_pam_diymenus" ("parent_id")
137
+  (0.0ms) SELECT sql
138
+ FROM sqlite_master
139
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
140
+ UNION ALL
141
+ SELECT sql
142
+ FROM sqlite_temp_master
143
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
144
+
145
+  (0.0ms)  SELECT sql
146
+ FROM sqlite_master
147
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
148
+ UNION ALL
149
+ SELECT sql
150
+ FROM sqlite_temp_master
151
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
152
+ 
153
+  (0.1ms) CREATE INDEX "index_weixin_pam_diymenus_on_key" ON "weixin_pam_diymenus" ("key")
154
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20151212150808"]]
155
+  (2.2ms) commit transaction
156
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
157
+  (0.1ms) SELECT sql
158
+ FROM sqlite_master
159
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
160
+ UNION ALL
161
+ SELECT sql
162
+ FROM sqlite_temp_master
163
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
164
+
165
+  (0.1ms)  SELECT sql
166
+ FROM sqlite_master
167
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
168
+ UNION ALL
169
+ SELECT sql
170
+ FROM sqlite_temp_master
171
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
172
+ 
173
+  (0.1ms) SELECT sql
174
+ FROM sqlite_master
175
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
176
+ UNION ALL
177
+ SELECT sql
178
+ FROM sqlite_temp_master
179
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
180
+
181
+  (0.1ms)  SELECT sql
182
+ FROM sqlite_master
183
+ WHERE name='index_weixin_pam_user_accounts_on_weixin_pam_public_account_id' AND type='index'
184
+ UNION ALL
185
+ SELECT sql
186
+ FROM sqlite_temp_master
187
+ WHERE name='index_weixin_pam_user_accounts_on_weixin_pam_public_account_id' AND type='index'
188
+ 
189
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
190
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
191
+ Migrating to CreateWeixinPamDiymenus (20151212150808)
192
+  (0.1ms) begin transaction
193
+  (0.1ms) SELECT sql
194
+ FROM sqlite_master
195
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
196
+ UNION ALL
197
+ SELECT sql
198
+ FROM sqlite_temp_master
199
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
200
+
201
+  (0.1ms)  SELECT sql
202
+ FROM sqlite_master
203
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
204
+ UNION ALL
205
+ SELECT sql
206
+ FROM sqlite_temp_master
207
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
208
+ 
209
+  (0.1ms) SELECT sql
210
+ FROM sqlite_master
211
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
212
+ UNION ALL
213
+ SELECT sql
214
+ FROM sqlite_temp_master
215
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
216
+
217
+  (0.4ms) DROP INDEX "index_weixin_pam_diymenus_on_key"
218
+  (0.9ms) DROP TABLE "weixin_pam_diymenus"
219
+ SQL (0.2ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = ? [["version", "20151212150808"]]
220
+  (0.6ms) commit transaction
221
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
222
+  (0.1ms) SELECT sql
223
+ FROM sqlite_master
224
+ WHERE name='index_weixin_pam_user_accounts_on_weixin_pam_public_account_id' AND type='index'
225
+ UNION ALL
226
+ SELECT sql
227
+ FROM sqlite_temp_master
228
+ WHERE name='index_weixin_pam_user_accounts_on_weixin_pam_public_account_id' AND type='index'
229
+
230
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
231
+ Migrating to CreateWeixinPamDiymenus (20151212150808)
232
+  (0.1ms) begin transaction
233
+  (0.3ms) CREATE TABLE "weixin_pam_diymenus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "public_account_id" integer, "parent_id" integer, "name" varchar, "key" varchar, "url" varchar, "is_show" boolean, "sort" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
234
+  (0.0ms) select sqlite_version(*)
235
+  (0.1ms) CREATE INDEX "index_weixin_pam_diymenus_on_public_account_id" ON "weixin_pam_diymenus" ("public_account_id")
236
+  (0.1ms) SELECT sql
237
+ FROM sqlite_master
238
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
239
+ UNION ALL
240
+ SELECT sql
241
+ FROM sqlite_temp_master
242
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
243
+
244
+  (0.1ms) CREATE INDEX "index_weixin_pam_diymenus_on_parent_id" ON "weixin_pam_diymenus" ("parent_id")
245
+  (0.1ms) SELECT sql
246
+ FROM sqlite_master
247
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
248
+ UNION ALL
249
+ SELECT sql
250
+ FROM sqlite_temp_master
251
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
252
+
253
+  (0.0ms)  SELECT sql
254
+ FROM sqlite_master
255
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
256
+ UNION ALL
257
+ SELECT sql
258
+ FROM sqlite_temp_master
259
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
260
+ 
261
+  (0.1ms) CREATE INDEX "index_weixin_pam_diymenus_on_key" ON "weixin_pam_diymenus" ("key")
262
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20151212150808"]]
263
+  (2.2ms) commit transaction
264
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
265
+  (0.1ms) SELECT sql
266
+ FROM sqlite_master
267
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
268
+ UNION ALL
269
+ SELECT sql
270
+ FROM sqlite_temp_master
271
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
272
+
273
+  (0.1ms)  SELECT sql
274
+ FROM sqlite_master
275
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
276
+ UNION ALL
277
+ SELECT sql
278
+ FROM sqlite_temp_master
279
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
280
+ 
281
+  (0.1ms) SELECT sql
282
+ FROM sqlite_master
283
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
284
+ UNION ALL
285
+ SELECT sql
286
+ FROM sqlite_temp_master
287
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
288
+
289
+  (0.1ms)  SELECT sql
290
+ FROM sqlite_master
291
+ WHERE name='index_weixin_pam_user_accounts_on_weixin_pam_public_account_id' AND type='index'
292
+ UNION ALL
293
+ SELECT sql
294
+ FROM sqlite_temp_master
295
+ WHERE name='index_weixin_pam_user_accounts_on_weixin_pam_public_account_id' AND type='index'
296
+ 
297
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
298
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
299
+  (0.1ms)  SELECT sql
300
+ FROM sqlite_master
301
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
302
+ UNION ALL
303
+ SELECT sql
304
+ FROM sqlite_temp_master
305
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
306
+ 
307
+  (0.1ms) SELECT sql
308
+ FROM sqlite_master
309
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
310
+ UNION ALL
311
+ SELECT sql
312
+ FROM sqlite_temp_master
313
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
314
+
315
+  (0.1ms)  SELECT sql
316
+ FROM sqlite_master
317
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
318
+ UNION ALL
319
+ SELECT sql
320
+ FROM sqlite_temp_master
321
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
322
+ 
323
+  (0.1ms) SELECT sql
324
+ FROM sqlite_master
325
+ WHERE name='index_weixin_pam_user_accounts_on_weixin_pam_public_account_id' AND type='index'
326
+ UNION ALL
327
+ SELECT sql
328
+ FROM sqlite_temp_master
329
+ WHERE name='index_weixin_pam_user_accounts_on_weixin_pam_public_account_id' AND type='index'
330
+
331
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
332
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
333
+  (0.1ms)  SELECT sql
334
+ FROM sqlite_master
335
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
336
+ UNION ALL
337
+ SELECT sql
338
+ FROM sqlite_temp_master
339
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
340
+ 
341
+  (0.1ms) SELECT sql
342
+ FROM sqlite_master
343
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
344
+ UNION ALL
345
+ SELECT sql
346
+ FROM sqlite_temp_master
347
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
348
+
349
+  (0.1ms)  SELECT sql
350
+ FROM sqlite_master
351
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
352
+ UNION ALL
353
+ SELECT sql
354
+ FROM sqlite_temp_master
355
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
356
+ 
357
+  (0.1ms) SELECT sql
358
+ FROM sqlite_master
359
+ WHERE name='index_weixin_pam_user_accounts_on_weixin_pam_public_account_id' AND type='index'
360
+ UNION ALL
361
+ SELECT sql
362
+ FROM sqlite_temp_master
363
+ WHERE name='index_weixin_pam_user_accounts_on_weixin_pam_public_account_id' AND type='index'
364
+
365
+  (1.1ms) CREATE TABLE "weixin_pam_diymenus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "public_account_id" integer, "parent_id" integer, "name" varchar, "key" varchar, "url" varchar, "is_show" boolean, "sort" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
366
+  (0.1ms) select sqlite_version(*)
367
+  (0.7ms) CREATE INDEX "index_weixin_pam_diymenus_on_key" ON "weixin_pam_diymenus" ("key")
368
+  (0.1ms) SELECT sql
369
+ FROM sqlite_master
370
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
371
+ UNION ALL
372
+ SELECT sql
373
+ FROM sqlite_temp_master
374
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
375
+
376
+  (0.6ms) CREATE INDEX "index_weixin_pam_diymenus_on_parent_id" ON "weixin_pam_diymenus" ("parent_id")
377
+  (0.1ms) SELECT sql
378
+ FROM sqlite_master
379
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
380
+ UNION ALL
381
+ SELECT sql
382
+ FROM sqlite_temp_master
383
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
384
+
385
+  (0.1ms)  SELECT sql
386
+ FROM sqlite_master
387
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
388
+ UNION ALL
389
+ SELECT sql
390
+ FROM sqlite_temp_master
391
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
392
+ 
393
+  (0.6ms) CREATE INDEX "index_weixin_pam_diymenus_on_public_account_id" ON "weixin_pam_diymenus" ("public_account_id")
394
+  (0.6ms) CREATE TABLE "weixin_pam_public_accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "app_id" varchar, "app_secret" varchar, "api_url" varchar, "api_token" varchar, "enabled" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
395
+  (0.6ms) CREATE TABLE "weixin_pam_user_accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "weixin_pam_public_account_id" integer, "uid" varchar, "nickname" varchar, "headshot" varchar, "subscribed" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
396
+  (0.6ms) CREATE INDEX "index_weixin_pam_user_accounts_on_weixin_pam_public_account_id" ON "weixin_pam_user_accounts" ("weixin_pam_public_account_id")
397
+  (0.7ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
398
+  (0.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
399
+  (0.1ms) SELECT version FROM "schema_migrations"
400
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20151212150808')
401
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20151211153307')
402
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20151211153353')
403
+  (0.6ms) CREATE TABLE "weixin_pam_diymenus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "public_account_id" integer, "parent_id" integer, "name" varchar, "key" varchar, "url" varchar, "is_show" boolean, "sort" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
404
+  (0.0ms) select sqlite_version(*)
405
+  (0.5ms) CREATE INDEX "index_weixin_pam_diymenus_on_key" ON "weixin_pam_diymenus" ("key")
406
+  (0.1ms)  SELECT sql
407
+ FROM sqlite_master
408
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
409
+ UNION ALL
410
+ SELECT sql
411
+ FROM sqlite_temp_master
412
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
413
+ 
414
+  (0.7ms) CREATE INDEX "index_weixin_pam_diymenus_on_parent_id" ON "weixin_pam_diymenus" ("parent_id")
415
+  (0.1ms)  SELECT sql
416
+ FROM sqlite_master
417
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
418
+ UNION ALL
419
+ SELECT sql
420
+ FROM sqlite_temp_master
421
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
422
+ 
423
+  (0.1ms) SELECT sql
424
+ FROM sqlite_master
425
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
426
+ UNION ALL
427
+ SELECT sql
428
+ FROM sqlite_temp_master
429
+ WHERE name='index_weixin_pam_diymenus_on_key' AND type='index'
430
+
431
+  (0.6ms) CREATE INDEX "index_weixin_pam_diymenus_on_public_account_id" ON "weixin_pam_diymenus" ("public_account_id")
432
+  (0.6ms) CREATE TABLE "weixin_pam_public_accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "app_id" varchar, "app_secret" varchar, "api_url" varchar, "api_token" varchar, "enabled" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
433
+  (0.6ms) CREATE TABLE "weixin_pam_user_accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "weixin_pam_public_account_id" integer, "uid" varchar, "nickname" varchar, "headshot" varchar, "subscribed" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
434
+  (0.6ms) CREATE INDEX "index_weixin_pam_user_accounts_on_weixin_pam_public_account_id" ON "weixin_pam_user_accounts" ("weixin_pam_public_account_id")
435
+  (0.5ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
436
+  (0.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
437
+  (0.1ms) SELECT version FROM "schema_migrations"
438
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20151212150808')
439
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20151211153307')
440
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20151211153353')
441
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
442
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
443
+ Migrating to CreateWeixinPamDiymenus (20151212152624)
444
+  (0.1ms) begin transaction
445
+  (0.1ms) CREATE TABLE "weixin_pam_diymenus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "public_account_id" integer, "parent_id" integer, "name" varchar, "key" varchar, "url" varchar, "is_show" boolean, "sort" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
446
+  (0.0ms) rollback transaction
447
+  (2.5ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
448
+  (0.1ms) select sqlite_version(*)
449
+  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
450
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
451
+ Migrating to CreateWeixinPamPublicAccounts (20151211153307)
452
+  (0.1ms) begin transaction
453
+  (0.3ms) CREATE TABLE "weixin_pam_public_accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "app_id" varchar, "app_secret" varchar, "api_url" varchar, "api_token" varchar, "enabled" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
454
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20151211153307"]]
455
+  (0.6ms) commit transaction
456
+ Migrating to CreateWeixinPamUserAccounts (20151211153353)
457
+  (0.1ms) begin transaction
458
+  (0.3ms) CREATE TABLE "weixin_pam_user_accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "public_account_id" integer, "uid" varchar, "nickname" varchar, "headshot" varchar, "subscribed" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
459
+  (0.1ms) CREATE INDEX "index_weixin_pam_user_accounts_on_public_account_id" ON "weixin_pam_user_accounts" ("public_account_id")
460
+  (0.1ms) SELECT sql
461
+ FROM sqlite_master
462
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
463
+ UNION ALL
464
+ SELECT sql
465
+ FROM sqlite_temp_master
466
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
467
+
468
+  (1.1ms) CREATE UNIQUE INDEX "index_weixin_pam_user_accounts_on_public_account_id_and_uid" ON "weixin_pam_user_accounts" ("public_account_id", "uid")
469
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20151211153353"]]
470
+  (2.6ms) commit transaction
471
+ Migrating to CreateWeixinPamDiymenus (20151212152624)
472
+  (0.0ms) begin transaction
473
+  (0.2ms) CREATE TABLE "weixin_pam_diymenus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "public_account_id" integer, "parent_id" integer, "name" varchar, "key" varchar, "url" varchar, "is_show" boolean, "sort" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
474
+  (0.1ms) CREATE INDEX "index_weixin_pam_diymenus_on_public_account_id" ON "weixin_pam_diymenus" ("public_account_id")
475
+  (0.0ms)  SELECT sql
476
+ FROM sqlite_master
477
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
478
+ UNION ALL
479
+ SELECT sql
480
+ FROM sqlite_temp_master
481
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
482
+ 
483
+  (0.1ms) CREATE INDEX "index_weixin_pam_diymenus_on_parent_id" ON "weixin_pam_diymenus" ("parent_id")
484
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20151212152624"]]
485
+  (0.6ms) commit transaction
486
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
487
+  (0.1ms) SELECT sql
488
+ FROM sqlite_master
489
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
490
+ UNION ALL
491
+ SELECT sql
492
+ FROM sqlite_temp_master
493
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
494
+
495
+  (0.1ms)  SELECT sql
496
+ FROM sqlite_master
497
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
498
+ UNION ALL
499
+ SELECT sql
500
+ FROM sqlite_temp_master
501
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
502
+ 
503
+  (0.1ms) SELECT sql
504
+ FROM sqlite_master
505
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id_and_uid' AND type='index'
506
+ UNION ALL
507
+ SELECT sql
508
+ FROM sqlite_temp_master
509
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id_and_uid' AND type='index'
510
+
511
+  (0.1ms)  SELECT sql
512
+ FROM sqlite_master
513
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
514
+ UNION ALL
515
+ SELECT sql
516
+ FROM sqlite_temp_master
517
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
518
+ 
519
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
520
+ Migrating to AddWeixinSecretKeyAndWeixinTokenToPublicAccounts (20151215140830)
521
+  (0.1ms) begin transaction
522
+  (0.0ms) rollback transaction
523
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
524
+ Migrating to AddWeixinSecretKeyAndWeixinTokenToPublicAccounts (20151215140830)
525
+  (0.1ms) begin transaction
526
+  (0.1ms) ALTER TABLE "public_accounts" ADD "weixin_secret_key" varchar
527
+  (0.0ms) rollback transaction
528
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
529
+ Migrating to AddWeixinSecretKeyAndWeixinTokenToPublicAccounts (20151215140830)
530
+  (0.1ms) begin transaction
531
+  (0.4ms) ALTER TABLE "weixin_pam_public_accounts" ADD "weixin_secret_key" varchar
532
+  (0.1ms) ALTER TABLE "weixin_pam_public_accounts" ADD "weixin_token" varchar
533
+  (2.1ms) select sqlite_version(*)
534
+  (0.4ms) CREATE INDEX "index_weixin_pam_public_accounts_on_weixin_secret_key" ON "weixin_pam_public_accounts" ("weixin_secret_key")
535
+  (0.1ms)  SELECT sql
536
+ FROM sqlite_master
537
+ WHERE name='index_weixin_pam_public_accounts_on_weixin_secret_key' AND type='index'
538
+ UNION ALL
539
+ SELECT sql
540
+ FROM sqlite_temp_master
541
+ WHERE name='index_weixin_pam_public_accounts_on_weixin_secret_key' AND type='index'
542
+ 
543
+  (0.1ms) CREATE INDEX "index_weixin_pam_public_accounts_on_weixin_token" ON "weixin_pam_public_accounts" ("weixin_token")
544
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20151215140830"]]
545
+  (2.0ms) commit transaction
546
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
547
+  (0.1ms) SELECT sql
548
+ FROM sqlite_master
549
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
550
+ UNION ALL
551
+ SELECT sql
552
+ FROM sqlite_temp_master
553
+ WHERE name='index_weixin_pam_diymenus_on_parent_id' AND type='index'
554
+
555
+  (0.1ms)  SELECT sql
556
+ FROM sqlite_master
557
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
558
+ UNION ALL
559
+ SELECT sql
560
+ FROM sqlite_temp_master
561
+ WHERE name='index_weixin_pam_diymenus_on_public_account_id' AND type='index'
562
+ 
563
+  (0.1ms) SELECT sql
564
+ FROM sqlite_master
565
+ WHERE name='index_weixin_pam_public_accounts_on_weixin_token' AND type='index'
566
+ UNION ALL
567
+ SELECT sql
568
+ FROM sqlite_temp_master
569
+ WHERE name='index_weixin_pam_public_accounts_on_weixin_token' AND type='index'
570
+
571
+  (0.1ms)  SELECT sql
572
+ FROM sqlite_master
573
+ WHERE name='index_weixin_pam_public_accounts_on_weixin_secret_key' AND type='index'
574
+ UNION ALL
575
+ SELECT sql
576
+ FROM sqlite_temp_master
577
+ WHERE name='index_weixin_pam_public_accounts_on_weixin_secret_key' AND type='index'
578
+ 
579
+  (0.1ms) SELECT sql
580
+ FROM sqlite_master
581
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id_and_uid' AND type='index'
582
+ UNION ALL
583
+ SELECT sql
584
+ FROM sqlite_temp_master
585
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id_and_uid' AND type='index'
586
+
587
+  (0.1ms)  SELECT sql
588
+ FROM sqlite_master
589
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
590
+ UNION ALL
591
+ SELECT sql
592
+ FROM sqlite_temp_master
593
+ WHERE name='index_weixin_pam_user_accounts_on_public_account_id' AND type='index'
594
+