zena 1.0.0.rc2 → 1.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +23 -0
- data/README.rdoc +1 -1
- data/app/controllers/columns_controller.rb +3 -31
- data/app/controllers/comments_controller.rb +8 -3
- data/app/controllers/data_entries_controller.rb +1 -1
- data/app/controllers/documents_controller.rb +2 -2
- data/app/controllers/nodes_controller.rb +29 -12
- data/app/controllers/relations_controller.rb +2 -2
- data/app/controllers/sites_controller.rb +1 -1
- data/app/controllers/user_sessions_controller.rb +6 -3
- data/app/controllers/users_controller.rb +18 -16
- data/app/controllers/versions_controller.rb +20 -18
- data/app/controllers/virtual_classes_controller.rb +103 -17
- data/app/helpers/users_helper.rb +1 -1
- data/app/models/column.rb +19 -50
- data/app/models/comment.rb +2 -1
- data/app/models/node.rb +45 -22
- data/app/models/relation.rb +13 -0
- data/app/models/relation_proxy.rb +3 -2
- data/app/models/role.rb +213 -4
- data/app/models/site.rb +18 -11
- data/app/models/template.rb +37 -35
- data/app/models/version.rb +1 -1
- data/app/models/virtual_class.rb +154 -86
- data/app/views/columns/_li.html.erb +1 -1
- data/app/views/columns/index.html.erb +1 -9
- data/app/views/comments/index.rhtml +10 -8
- data/app/views/documents/_crop.rhtml +5 -6
- data/app/views/documents/crop_form.rjs +3 -2
- data/app/views/groups/index.rhtml +1 -1
- data/app/views/iformats/index.rhtml +1 -1
- data/app/views/nodes/_import_results.rhtml +1 -1
- data/app/views/nodes/_parent.rhtml +1 -2
- data/app/views/nodes/update.rjs +3 -4
- data/app/views/relations/index.erb +1 -1
- data/app/views/sites/index.erb +1 -1
- data/app/views/templates/drive_tabs/_drive.rhtml +0 -2
- data/app/views/templates/edit_tabs/_image.rhtml +1 -1
- data/app/views/templates/edit_tabs/_title.rhtml +0 -6
- data/app/views/users/index.rhtml +1 -1
- data/app/views/users/preferences.html.erb +2 -2
- data/app/views/versions/backup.rjs +1 -1
- data/app/views/versions/custom_tab.rhtml +9 -4
- data/app/views/versions/destroy.rjs +2 -2
- data/app/views/versions/update.rjs +2 -9
- data/app/views/virtual_classes/_form.erb +3 -2
- data/app/views/virtual_classes/import_prepare.html.erb +13 -0
- data/app/views/virtual_classes/index.erb +28 -8
- data/app/views/zafu/default/Node-+adminLayout.zafu +1 -13
- data/app/views/zafu/default/Node-+login.zafu +1 -0
- data/app/views/zafu/default/Node-+notFound.zafu +1 -1
- data/app/views/zafu/default/Node-+popupLayout.zafu +1 -2
- data/app/views/zafu/default/Node-+search.zafu +1 -1
- data/app/views/zafu/default/Node-admin.zafu +205 -0
- data/app/views/zafu/default/Node.zafu +11 -11
- data/bricks/captcha/lib/bricks/captcha.rb +3 -2
- data/bricks/mongrel/zena/init.rb +2 -1
- data/bricks/pdf/README +5 -5
- data/bricks/pdf/lib/bricks/pdf/engine/prince.rb +2 -2
- data/bricks/pdf/lib/bricks/pdf/engine/xhtml2pdf.rb +2 -2
- data/bricks/pdf/lib/bricks/pdf/install.rb +5 -5
- data/bricks/pdf/lib/bricks/pdf.rb +11 -11
- data/bricks/pdf/test/engines/test_prince.rb +4 -4
- data/bricks/pdf/test/engines/test_xhtml2pdf.rb +4 -4
- data/bricks/pdf/test/shoulda_macros/shoulda_pdf.rb +2 -2
- data/bricks/pdf/zena/init.rb +2 -2
- data/bricks/pdf/zena/tasks.rb +2 -2
- data/bricks/sphinx/lib/bricks/sphinx.rb +6 -2
- data/bricks/sphinx/zena/{sphinx.yml → sphinx.yml.erb} +2 -2
- data/bricks/sphinx/zena/tasks.rb +28 -2
- data/bricks/tags/lib/bricks/tags.rb +16 -1
- data/bricks/tags/zena/test/unit/tags_test.rb +15 -0
- data/bricks/tags/zena/test/zafu/tags.yml +5 -1
- data/bricks/worker/lib/bricks/worker.rb +39 -0
- data/bricks/worker/zena/deploy.rb +0 -2
- data/bricks/worker/zena/init.rb +1 -0
- data/bricks/worker/zena/test/sites/zena/delayed_jobs.yml +16 -0
- data/bricks/worker/zena/test/zafu/worker.yml +8 -0
- data/bricks/zena/zena/migrate/01_base.rb +36 -60
- data/bricks/zena/zena/migrate/02_zerox1_schema.rb +388 -0
- data/bricks/zena/zena/migrate/03_zerox1_data.rb +380 -0
- data/bricks/zena/zena/migrate/20110315161158_add_reverse_scope_to_roles.rb +9 -0
- data/config/database_example.yml +1 -1
- data/config/environment.rb +1 -1
- data/config/gems.yml +17 -14
- data/db/init/base/skins/default/Node-+index.zafu +8 -1
- data/db/init/base/skins/default/Node-+login.zafu +1 -0
- data/db/init/base/skins/default/Node-+popupLayout.zafu +1 -2
- data/db/init/base/skins/default/Node-+search.zafu +2 -2
- data/db/init/base/skins/default/Node.zafu +9 -9
- data/db/init/base/skins/default/{favicon.png → img/favicon.png} +0 -0
- data/db/init/base/skins/default/{style.css → img/style.css} +0 -0
- data/db/init/base/skins/default/img/translations.yml +11 -0
- data/db/init/base/skins/default/notes.zafu +7 -9
- data/doc/zafu_changes.yml +12 -0
- data/lib/bricks/loader.rb +38 -15
- data/lib/tasks/zena.rake +74 -24
- data/lib/zena/acts/enrollable.rb +4 -1
- data/lib/zena/acts/secure.rb +2 -48
- data/lib/zena/acts/serializable.rb +13 -1
- data/lib/zena/app.rb +9 -0
- data/lib/zena/code_syntax.rb +154 -151
- data/lib/zena/console.rb +141 -0
- data/lib/zena/controller/test_case.rb +1 -1
- data/lib/zena/db_helper/abstract_db.rb +17 -5
- data/lib/zena/db_helper/mysql.rb +14 -12
- data/lib/zena/db_helper/postgresql.rb +1 -2
- data/lib/zena/db_helper/sqlite3.rb +6 -6
- data/lib/zena/deploy/awstats.conf.rhtml +1 -1
- data/lib/zena/deploy/httpd.rhtml +6 -1
- data/lib/zena/deploy/vhost.rhtml +9 -1
- data/lib/zena/deploy.rb +12 -7
- data/lib/zena/foxy_parser.rb +3 -1
- data/lib/zena/info.rb +1 -1
- data/lib/zena/parser/zafu_tags.rb +1 -0
- data/lib/zena/parser/zazen_rules.rb +1 -1
- data/lib/zena/remote/node.rb +15 -3
- data/lib/zena/remote/serializable_array.rb +19 -0
- data/lib/zena/remote.rb +1 -0
- data/lib/zena/routes.rb +7 -2
- data/lib/zena/site_worker.rb +11 -1
- data/lib/zena/unit/test_case.rb +68 -0
- data/lib/zena/use/action.rb +6 -2
- data/lib/zena/use/ajax.rb +127 -53
- data/lib/zena/use/ancestry.rb +11 -8
- data/lib/zena/use/calendar.rb +265 -129
- data/lib/zena/use/conditional.rb +1 -1
- data/lib/zena/use/context.rb +5 -5
- data/lib/zena/use/dates.rb +172 -60
- data/lib/zena/use/display.rb +70 -39
- data/lib/zena/use/error_rendering.rb +1 -3
- data/lib/zena/use/field_index.rb +4 -1
- data/lib/zena/use/forms.rb +94 -72
- data/lib/zena/use/fulltext.rb +16 -24
- data/lib/zena/use/html_tags.rb +20 -12
- data/lib/zena/use/i18n.rb +37 -37
- data/lib/zena/use/image_builder.rb +8 -1
- data/lib/zena/use/ml_index.rb +16 -16
- data/lib/zena/use/prop_eval.rb +10 -5
- data/lib/zena/use/query_builder.rb +55 -23
- data/lib/zena/use/query_node.rb +51 -25
- data/lib/zena/use/refactor.rb +2 -28
- data/lib/zena/use/relations.rb +1 -1
- data/lib/zena/use/rendering.rb +29 -0
- data/lib/zena/use/scope_index.rb +75 -14
- data/lib/zena/use/search.rb +5 -10
- data/lib/zena/use/test_helper.rb +2 -2
- data/lib/zena/use/urls.rb +125 -104
- data/lib/zena/use/workflow.rb +2 -1
- data/lib/zena/use/zafu_attributes.rb +2 -2
- data/lib/zena/use/zafu_safe_definitions.rb +20 -0
- data/lib/zena/use/zafu_templates.rb +20 -6
- data/lib/zena/use/zazen.rb +31 -20
- data/lib/zena/view/test_case.rb +5 -0
- data/lib/zena/zafu_compiler.rb +24 -2
- data/lib/zena.rb +12 -6
- data/locale/de/LC_MESSAGES/zena.mo +0 -0
- data/locale/de/zena.po +1345 -1164
- data/locale/en/LC_MESSAGES/zena.mo +0 -0
- data/locale/en/zena.po +1275 -1129
- data/locale/fr/LC_MESSAGES/zena.mo +0 -0
- data/locale/fr/zena.mo +0 -0
- data/locale/fr/zena.po +1617 -1441
- data/locale/log.txt +9 -0
- data/locale/zena.pot +957 -748
- data/public/javascripts/prototype.js +1 -1
- data/public/javascripts/zena.js +99 -44
- data/public/stylesheets/admin.css +6 -4
- data/public/stylesheets/backend.css +71 -0
- data/public/stylesheets/calendar.css +24 -25
- data/public/stylesheets/code.css +11 -6
- data/public/stylesheets/comment.css +2 -1
- data/public/stylesheets/popup.css +7 -8
- data/test/custom_queries/complex.host.yml +15 -1
- data/test/fixtures/files/Node-test.zafu +29 -28
- data/test/fixtures/files/translations_de.yml +12 -1
- data/test/fixtures/files/translations_fr.yml +12 -1
- data/test/functional/comments_controller_test.rb +9 -0
- data/test/functional/iformats_controller_test.rb +1 -1
- data/test/functional/nodes_controller_test.rb +124 -35
- data/test/functional/users_controller_test.rb +132 -3
- data/test/functional/virtual_classes_controller_test.rb +75 -4
- data/test/integration/navigation_test.rb +51 -9
- data/test/integration/query_node/basic.yml +19 -7
- data/test/integration/query_node/complex.yml +1 -1
- data/test/integration/query_node/dates.yml +27 -1
- data/test/integration/query_node/filters.yml +1 -1
- data/test/integration/query_node/relations.yml +13 -4
- data/test/integration/query_node_test.rb +4 -0
- data/test/integration/xml_api_test.rb +6 -1
- data/test/integration/zafu_compiler/action.yml +3 -3
- data/test/integration/zafu_compiler/ajax.yml +103 -22
- data/test/integration/zafu_compiler/basic.yml +0 -52
- data/test/integration/zafu_compiler/calendar.yml +44 -20
- data/test/integration/zafu_compiler/comments.yml +53 -0
- data/test/integration/zafu_compiler/complex.yml +11 -11
- data/test/integration/zafu_compiler/complex_ok.yml +16 -3
- data/test/integration/zafu_compiler/conditional.yml +15 -5
- data/test/integration/zafu_compiler/context.yml +9 -0
- data/test/integration/zafu_compiler/dates.yml +43 -15
- data/test/integration/zafu_compiler/display.yml +60 -6
- data/test/integration/zafu_compiler/errors.yml +6 -2
- data/test/integration/zafu_compiler/forms.yml +45 -6
- data/test/integration/zafu_compiler/i18n.yml +8 -1
- data/test/integration/zafu_compiler/meta.yml +38 -0
- data/test/integration/zafu_compiler/query.yml +43 -4
- data/test/integration/zafu_compiler/relations.yml +26 -33
- data/test/integration/zafu_compiler/rubyless.yml +10 -0
- data/test/integration/zafu_compiler/safe_definitions.yml +21 -1
- data/test/integration/zafu_compiler/urls.yml +75 -5
- data/test/integration/zafu_compiler/version.yml +2 -2
- data/test/integration/zafu_compiler/zafu_attributes.yml +5 -1
- data/test/integration/zafu_compiler/zazen.yml +14 -6
- data/test/integration/zafu_compiler_test.rb +5 -1
- data/test/sites/complex/columns.yml +5 -0
- data/test/sites/complex/roles.yml +4 -0
- data/test/sites/zena/nodes.yml +13 -2
- data/test/sites/zena/roles.yml +13 -5
- data/test/sites/zena/versions.yml +27 -9
- data/test/unit/column_test.rb +51 -5
- data/test/unit/iformat_test.rb +2 -2
- data/test/unit/node_test.rb +29 -17
- data/test/unit/note_test.rb +1 -1
- data/test/unit/relation_proxy_test.rb +4 -5
- data/test/unit/relation_test.rb +16 -0
- data/test/unit/remote_test.rb +2 -2
- data/test/unit/role_test.rb +292 -4
- data/test/unit/site_test.rb +12 -0
- data/test/unit/template_test.rb +1 -1
- data/test/unit/text_document_test.rb +1 -1
- data/test/unit/virtual_class_test.rb +200 -83
- data/test/unit/zena/acts/enrollable_test.rb +26 -31
- data/test/unit/zena/use/calendar_test.rb +90 -37
- data/test/unit/zena/use/field_index_test.rb +28 -0
- data/test/unit/zena/use/html_tags_test.rb +7 -3
- data/test/unit/zena/use/ml_index_test.rb +2 -16
- data/test/unit/zena/use/nested_attributes_alias_view_test.rb +2 -2
- data/test/unit/zena/use/prop_eval_test.rb +50 -8
- data/test/unit/zena/use/query_node_test.rb +11 -0
- data/test/unit/zena/use/rendering_test.rb +72 -0
- data/test/unit/zena/use/scope_index_test.rb +37 -2
- data/test/unit/zena/use/urls_test.rb +10 -0
- data/test/unit/zena/use/zazen_test.rb +3 -3
- data/vendor/plugins/gettext_i18n_rails/Gemfile +11 -0
- data/vendor/plugins/gettext_i18n_rails/Gemfile.lock +92 -0
- data/vendor/plugins/gettext_i18n_rails/Rakefile +12 -17
- data/vendor/plugins/gettext_i18n_rails/Readme.md +215 -0
- data/vendor/plugins/gettext_i18n_rails/VERSION +1 -1
- data/vendor/plugins/gettext_i18n_rails/gettext_i18n_rails.gemspec +38 -34
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/active_record.rb +1 -1
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/backend.rb +30 -14
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/haml_parser.rb +1 -1
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/html_safe_translations.rb +29 -0
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/i18n_hacks.rb +29 -1
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/model_attributes_finder.rb +7 -1
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/railtie.rb +10 -0
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/ruby_gettext_extractor.rb +6 -2
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/string_interpolate_fix.rb +20 -0
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/tasks.rb +120 -0
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails.rb +10 -3
- data/vendor/plugins/gettext_i18n_rails/lib/tasks/gettext_rails_i18n.rake +1 -74
- data/vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails/active_record_spec.rb +51 -20
- data/vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails/backend_spec.rb +12 -7
- data/vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails/string_interpolate_fix_spec.rb +32 -0
- data/vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails_spec.rb +38 -1
- data/vendor/plugins/gettext_i18n_rails/spec/rails2/Gemfile +11 -0
- data/vendor/plugins/gettext_i18n_rails/spec/spec_helper.rb +1 -8
- data/zena.gemspec +2241 -2217
- metadata +123 -83
- data/.gitignore +0 -36
- data/app/views/nodes/_dates.rhtml +0 -13
- data/db/init/base/skins/default/Node-+adminLayout.zafu +0 -46
- data/db/init/base/skins/default/Node-tree.zafu +0 -19
- data/vendor/plugins/gettext_i18n_rails/README.markdown +0 -143
@@ -0,0 +1,388 @@
|
|
1
|
+
# This migration should be run in the 0.x branch with:
|
2
|
+
# 1. all brickes turned to OFF (important)
|
3
|
+
# 2. YOU *MUST* alter schema migrations before running this
|
4
|
+
# DelayedJobs migration not taken into account here.
|
5
|
+
class Zerox1Schema < ActiveRecord::Migration
|
6
|
+
def self.up
|
7
|
+
$Zerox1SchemaRunning = true
|
8
|
+
|
9
|
+
if connection.tables.include?('idx_templates')
|
10
|
+
# New app based on 1.0: do nothing
|
11
|
+
puts "=> Detected 1.0+ schema: not running Zerox1Schema."
|
12
|
+
return
|
13
|
+
end
|
14
|
+
|
15
|
+
table_options = Zena::Db.table_options
|
16
|
+
|
17
|
+
# ============================================ access_hits
|
18
|
+
# removed in cleanup migration
|
19
|
+
|
20
|
+
# ============================================ attachments
|
21
|
+
|
22
|
+
create_table "attachments", :options => table_options, :force => true do |t|
|
23
|
+
t.string "filename"
|
24
|
+
t.integer "site_id"
|
25
|
+
t.integer "user_id"
|
26
|
+
t.datetime "created_at"
|
27
|
+
t.datetime "updated_at"
|
28
|
+
end
|
29
|
+
|
30
|
+
# ============================================ cached_pages
|
31
|
+
execute "ALTER TABLE cached_pages COLLATE utf8_unicode_ci"
|
32
|
+
execute "ALTER TABLE cached_pages MODIFY path TEXT COLLATE utf8_unicode_ci"
|
33
|
+
add_index "cached_pages", ["node_id"], :name => "index_cached_pages_on_node_id"
|
34
|
+
|
35
|
+
# ============================================ cached_pages_nodes
|
36
|
+
execute "ALTER TABLE cached_pages_nodes COLLATE utf8_unicode_ci"
|
37
|
+
add_index "cached_pages_nodes", ["node_id"], :name => "index_cached_pages_nodes_on_node_id"
|
38
|
+
add_index "cached_pages_nodes", ["cached_page_id"], :name => "index_cached_pages_nodes_on_cached_page_id"
|
39
|
+
|
40
|
+
# ============================================ caches
|
41
|
+
execute "ALTER TABLE caches COLLATE utf8_unicode_ci"
|
42
|
+
execute "ALTER TABLE caches MODIFY visitor_groups VARCHAR(200) COLLATE utf8_unicode_ci DEFAULT NULL"
|
43
|
+
execute "ALTER TABLE caches MODIFY kpath VARCHAR(200) COLLATE utf8_unicode_ci DEFAULT NULL"
|
44
|
+
execute "ALTER TABLE caches MODIFY content TEXT COLLATE utf8_unicode_ci"
|
45
|
+
|
46
|
+
# ============================================ comments
|
47
|
+
create_table "columns", :options => table_options, :force => true do |t|
|
48
|
+
t.integer "role_id"
|
49
|
+
t.string "name"
|
50
|
+
t.string "ptype"
|
51
|
+
t.datetime "created_at"
|
52
|
+
t.datetime "updated_at"
|
53
|
+
t.integer "site_id"
|
54
|
+
t.string "index", :limit => 30
|
55
|
+
end
|
56
|
+
|
57
|
+
add_index "columns", ["role_id"], :name => "index_columns_on_role_id"
|
58
|
+
add_index "columns", ["name"], :name => "index_columns_on_name"
|
59
|
+
|
60
|
+
# ============================================ comments
|
61
|
+
execute "ALTER TABLE comments COLLATE utf8_unicode_ci"
|
62
|
+
execute "ALTER TABLE comments MODIFY title VARCHAR(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT ''"
|
63
|
+
execute "ALTER TABLE comments MODIFY `text` TEXT COLLATE utf8_unicode_ci NOT NULL"
|
64
|
+
execute "ALTER TABLE comments MODIFY author_name VARCHAR(300) COLLATE utf8_unicode_ci DEFAULT NULL"
|
65
|
+
execute "ALTER TABLE comments MODIFY ip VARCHAR(200) COLLATE utf8_unicode_ci DEFAULT NULL"
|
66
|
+
|
67
|
+
add_index "comments", ["discussion_id"], :name => "index_comments_on_discussion_id"
|
68
|
+
add_index "comments", ["reply_to"], :name => "index_comments_on_reply_to"
|
69
|
+
add_index "comments", ["user_id"], :name => "index_comments_on_user_id"
|
70
|
+
|
71
|
+
# ============================================ contact_contents
|
72
|
+
# content migrated in zero99_to_one
|
73
|
+
|
74
|
+
# ============================================ data_entries
|
75
|
+
execute "ALTER TABLE data_entries COLLATE utf8_unicode_ci"
|
76
|
+
execute "ALTER TABLE data_entries MODIFY `text` TEXT COLLATE utf8_unicode_ci"
|
77
|
+
|
78
|
+
add_index "data_entries", ["node_a_id"], :name => "index_data_entries_on_node_a_id"
|
79
|
+
add_index "data_entries", ["node_b_id"], :name => "index_data_entries_on_node_b_id"
|
80
|
+
add_index "data_entries", ["node_c_id"], :name => "index_data_entries_on_node_c_id"
|
81
|
+
add_index "data_entries", ["node_d_id"], :name => "index_data_entries_on_node_d_id"
|
82
|
+
|
83
|
+
# ============================================ delayed_jobs
|
84
|
+
# ignore
|
85
|
+
|
86
|
+
# ============================================ discussions
|
87
|
+
execute "ALTER TABLE discussions COLLATE utf8_unicode_ci"
|
88
|
+
execute "ALTER TABLE discussions MODIFY `lang` VARCHAR(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT ''"
|
89
|
+
|
90
|
+
add_index "discussions", ["node_id"], :name => "index_discussions_on_node_id"
|
91
|
+
|
92
|
+
# ============================================ document_contents
|
93
|
+
# content migrated in zero99_to_one
|
94
|
+
|
95
|
+
# ============================================ form_lines
|
96
|
+
# removed in cleanup migration
|
97
|
+
|
98
|
+
# ============================================ form_seizures
|
99
|
+
# removed in cleanup migration
|
100
|
+
|
101
|
+
# ============================================ groups
|
102
|
+
execute "ALTER TABLE groups COLLATE utf8_unicode_ci"
|
103
|
+
execute "ALTER TABLE groups MODIFY `name` VARCHAR(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT ''"
|
104
|
+
|
105
|
+
# ============================================ groups_users
|
106
|
+
execute "ALTER TABLE groups_users COLLATE utf8_unicode_ci"
|
107
|
+
execute "ALTER TABLE groups_users MODIFY `group_id` INT(11) NOT NULL"
|
108
|
+
execute "ALTER TABLE groups_users MODIFY `user_id` INT(11) NOT NULL"
|
109
|
+
|
110
|
+
add_index "groups_users", ["group_id"], :name => "index_groups_users_on_group_id"
|
111
|
+
add_index "groups_users", ["user_id"], :name => "index_groups_users_on_user_id"
|
112
|
+
|
113
|
+
# ============================================ dyn_attributes
|
114
|
+
# content migrated in zero99_to_one
|
115
|
+
|
116
|
+
# ============================================ idx_...
|
117
|
+
create_table "idx_nodes_datetimes", :options => table_options, :force => true do |t|
|
118
|
+
t.integer "node_id", :null => false
|
119
|
+
t.string "key"
|
120
|
+
t.datetime "value"
|
121
|
+
end
|
122
|
+
|
123
|
+
add_index "idx_nodes_datetimes", ["node_id", "key"], :name => "index_idx_nodes_datetimes_on_node_id_and_key"
|
124
|
+
add_index "idx_nodes_datetimes", ["value"], :name => "index_idx_nodes_datetimes_on_value"
|
125
|
+
add_index "idx_nodes_datetimes", ["node_id"], :name => "index_idx_nodes_datetimes_on_node_id"
|
126
|
+
|
127
|
+
create_table "idx_nodes_floats", :options => table_options, :force => true do |t|
|
128
|
+
t.integer "node_id", :null => false
|
129
|
+
t.string "key"
|
130
|
+
t.float "value"
|
131
|
+
end
|
132
|
+
|
133
|
+
add_index "idx_nodes_floats", ["node_id", "key"], :name => "index_idx_nodes_floats_on_node_id_and_key"
|
134
|
+
add_index "idx_nodes_floats", ["value"], :name => "index_idx_nodes_floats_on_value"
|
135
|
+
add_index "idx_nodes_floats", ["node_id"], :name => "index_idx_nodes_floats_on_node_id"
|
136
|
+
|
137
|
+
create_table "idx_nodes_integers", :options => table_options, :force => true do |t|
|
138
|
+
t.integer "node_id", :null => false
|
139
|
+
t.string "key"
|
140
|
+
t.integer "value"
|
141
|
+
end
|
142
|
+
|
143
|
+
add_index "idx_nodes_integers", ["node_id", "key"], :name => "index_idx_nodes_integers_on_node_id_and_key"
|
144
|
+
add_index "idx_nodes_integers", ["value"], :name => "index_idx_nodes_integers_on_value"
|
145
|
+
add_index "idx_nodes_integers", ["node_id"], :name => "index_idx_nodes_integers_on_node_id"
|
146
|
+
|
147
|
+
create_table "idx_nodes_ml_strings", :options => table_options, :force => true do |t|
|
148
|
+
t.integer "node_id", :null => false
|
149
|
+
t.string "key"
|
150
|
+
t.string "lang", :limit => 10
|
151
|
+
t.string "value"
|
152
|
+
end
|
153
|
+
|
154
|
+
add_index "idx_nodes_ml_strings", ["node_id", "key", "lang"], :name => "index_idx_nodes_ml_strings_on_node_id_and_key_and_lang"
|
155
|
+
add_index "idx_nodes_ml_strings", ["value"], :name => "index_idx_nodes_ml_strings_on_value"
|
156
|
+
add_index "idx_nodes_ml_strings", ["node_id"], :name => "index_idx_nodes_ml_strings_on_node_id"
|
157
|
+
|
158
|
+
create_table "idx_nodes_strings", :options => table_options, :force => true do |t|
|
159
|
+
t.integer "node_id", :null => false
|
160
|
+
t.string "key"
|
161
|
+
t.string "value"
|
162
|
+
end
|
163
|
+
|
164
|
+
add_index "idx_nodes_strings", ["node_id", "key"], :name => "index_idx_nodes_strings_on_node_id_and_key"
|
165
|
+
add_index "idx_nodes_strings", ["value"], :name => "index_idx_nodes_strings_on_value"
|
166
|
+
add_index "idx_nodes_strings", ["node_id"], :name => "index_idx_nodes_strings_on_node_id"
|
167
|
+
|
168
|
+
# This is just for testing...
|
169
|
+
create_table "idx_projects", :options => table_options, :force => true do |t|
|
170
|
+
t.integer "site_id"
|
171
|
+
t.integer "node_id"
|
172
|
+
t.integer "blog_id"
|
173
|
+
t.string "blog_title"
|
174
|
+
t.integer "contact_id"
|
175
|
+
t.string "contact_first_name"
|
176
|
+
t.string "contact_name"
|
177
|
+
t.integer "reference_id"
|
178
|
+
t.string "reference_name"
|
179
|
+
t.string "reference_title"
|
180
|
+
t.integer "tag_id"
|
181
|
+
t.datetime "tag_created_at"
|
182
|
+
t.string "tag_title"
|
183
|
+
end
|
184
|
+
|
185
|
+
create_table "idx_templates", :options => table_options, :force => true do |t|
|
186
|
+
t.integer "site_id"
|
187
|
+
t.integer "node_id"
|
188
|
+
t.string "format"
|
189
|
+
t.string "tkpath"
|
190
|
+
t.string "mode"
|
191
|
+
t.integer "version_id"
|
192
|
+
t.integer "skin_id"
|
193
|
+
end
|
194
|
+
|
195
|
+
add_index "idx_templates", ["tkpath"], :name => "index_idx_templates_on_tkpath"
|
196
|
+
add_index "idx_templates", ["format"], :name => "index_idx_templates_on_format"
|
197
|
+
add_index "idx_templates", ["mode"], :name => "index_idx_templates_on_mode"
|
198
|
+
add_index "idx_templates", ["site_id"], :name => "index_idx_templates_on_site_id"
|
199
|
+
add_index "idx_templates", ["node_id"], :name => "index_idx_templates_on_node_id"
|
200
|
+
add_index "idx_templates", ["version_id"], :name => "index_idx_templates_on_version_id"
|
201
|
+
|
202
|
+
# ============================================ template_contents
|
203
|
+
# content migrated in zero99_to_one
|
204
|
+
|
205
|
+
# ============================================ iformats
|
206
|
+
execute "ALTER TABLE iformats COLLATE utf8_unicode_ci"
|
207
|
+
execute "ALTER TABLE iformats MODIFY `name` VARCHAR(40) COLLATE utf8_unicode_ci DEFAULT NULL"
|
208
|
+
execute "ALTER TABLE iformats MODIFY `popup` VARCHAR(120) COLLATE utf8_unicode_ci DEFAULT NULL"
|
209
|
+
|
210
|
+
# ============================================ links
|
211
|
+
execute "ALTER TABLE links COLLATE utf8_unicode_ci"
|
212
|
+
execute "ALTER TABLE links MODIFY `comment` VARCHAR(60) COLLATE utf8_unicode_ci DEFAULT NULL"
|
213
|
+
|
214
|
+
add_index "links", ["source_id"], :name => "index_links_on_source_id"
|
215
|
+
add_index "links", ["target_id"], :name => "index_links_on_target_id"
|
216
|
+
add_index "links", ["relation_id"], :name => "index_links_on_relation_id"
|
217
|
+
add_index "links", ["status"], :name => "index_links_on_status"
|
218
|
+
add_index "links", ["date"], :name => "index_links_on_date"
|
219
|
+
|
220
|
+
|
221
|
+
# ============================================ nodes
|
222
|
+
execute "ALTER TABLE nodes COLLATE utf8_unicode_ci"
|
223
|
+
execute "ALTER TABLE nodes MODIFY `type` VARCHAR(32) COLLATE utf8_unicode_ci DEFAULT NULL"
|
224
|
+
execute "ALTER TABLE nodes MODIFY `kpath` VARCHAR(16) COLLATE utf8_unicode_ci DEFAULT NULL"
|
225
|
+
execute "ALTER TABLE nodes MODIFY `user_id` INT(11) NOT NULL"
|
226
|
+
execute "ALTER TABLE nodes MODIFY `ref_lang` VARCHAR(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT ''"
|
227
|
+
execute "ALTER TABLE nodes MODIFY `vhash` TEXT COLLATE utf8_unicode_ci"
|
228
|
+
execute "ALTER TABLE nodes MODIFY `fullpath` TEXT COLLATE utf8_unicode_ci"
|
229
|
+
execute "ALTER TABLE nodes MODIFY `basepath` TEXT COLLATE utf8_unicode_ci"
|
230
|
+
# new
|
231
|
+
add_column :nodes, 'skin_id', :integer
|
232
|
+
add_column :nodes, "_id" , :string , :limit => 40
|
233
|
+
add_column :nodes, "idx_datetime1" , :datetime
|
234
|
+
add_column :nodes, "idx_datetime2" , :datetime
|
235
|
+
add_column :nodes, "idx_float1" , :float
|
236
|
+
add_column :nodes, "idx_float2" , :float
|
237
|
+
add_column :nodes, "idx_string1" , :string
|
238
|
+
add_column :nodes, "idx_string2" , :string
|
239
|
+
add_column :nodes, "idx_integer1" , :integer
|
240
|
+
add_column :nodes, "idx_integer2" , :integer
|
241
|
+
|
242
|
+
# idx
|
243
|
+
add_index "nodes", ["zip", "site_id"], :name => "index_nodes_on_zip_and_site_id"
|
244
|
+
add_index "nodes", ["kpath"], :name => "index_nodes_on_kpath"
|
245
|
+
add_index "nodes", ["parent_id"], :name => "index_nodes_on_parent_id"
|
246
|
+
add_index "nodes", ["project_id"], :name => "index_nodes_on_project_id"
|
247
|
+
add_index "nodes", ["section_id"], :name => "index_nodes_on_section_id"
|
248
|
+
add_index "nodes", ["rgroup_id"], :name => "index_nodes_on_rgroup_id"
|
249
|
+
add_index "nodes", ["wgroup_id"], :name => "index_nodes_on_wgroup_id"
|
250
|
+
add_index "nodes", ["publish_from"], :name => "index_nodes_on_publish_from"
|
251
|
+
add_index "nodes", ["site_id"], :name => "index_nodes_on_site_id"
|
252
|
+
add_index "nodes", ["idx_datetime1"], :name => "index_nodes_on_idx_datetime1"
|
253
|
+
add_index "nodes", ["idx_datetime2"], :name => "index_nodes_on_idx_datetime2"
|
254
|
+
add_index "nodes", ["idx_float1"], :name => "index_nodes_on_idx_float1"
|
255
|
+
add_index "nodes", ["idx_float2"], :name => "index_nodes_on_idx_float2"
|
256
|
+
add_index "nodes", ["idx_string1"], :name => "index_nodes_on_idx_string1"
|
257
|
+
add_index "nodes", ["idx_string2"], :name => "index_nodes_on_idx_string2"
|
258
|
+
add_index "nodes", ["idx_integer1"], :name => "index_nodes_on_idx_integer1"
|
259
|
+
add_index "nodes", ["idx_integer2"], :name => "index_nodes_on_idx_integer2"
|
260
|
+
|
261
|
+
# ============================================ nodes_roles
|
262
|
+
create_table "nodes_roles", :id => false, :force => true do |t|
|
263
|
+
t.integer "node_id", :default => 0, :null => false
|
264
|
+
t.integer "role_id", :default => 0, :null => false
|
265
|
+
end
|
266
|
+
|
267
|
+
add_index "nodes_roles", ["node_id"], :name => "index_nodes_roles_on_node_id"
|
268
|
+
add_index "nodes_roles", ["role_id"], :name => "index_nodes_roles_on_role_id"
|
269
|
+
|
270
|
+
# ============================================ relations
|
271
|
+
execute "ALTER TABLE relations COLLATE utf8_unicode_ci"
|
272
|
+
execute "ALTER TABLE relations MODIFY `source_role` VARCHAR(32) COLLATE utf8_unicode_ci DEFAULT NULL"
|
273
|
+
execute "ALTER TABLE relations MODIFY `source_kpath` VARCHAR(16) COLLATE utf8_unicode_ci DEFAULT NULL"
|
274
|
+
execute "ALTER TABLE relations MODIFY `source_icon` VARCHAR(200) COLLATE utf8_unicode_ci DEFAULT NULL"
|
275
|
+
|
276
|
+
execute "ALTER TABLE relations MODIFY `target_role` VARCHAR(32) COLLATE utf8_unicode_ci DEFAULT NULL"
|
277
|
+
execute "ALTER TABLE relations MODIFY `target_kpath` VARCHAR(16) COLLATE utf8_unicode_ci DEFAULT NULL"
|
278
|
+
execute "ALTER TABLE relations MODIFY `target_icon` VARCHAR(200) COLLATE utf8_unicode_ci DEFAULT NULL"
|
279
|
+
|
280
|
+
add_column :relations, :rel_group, :string
|
281
|
+
|
282
|
+
add_index "relations", ["source_role"], :name => "index_relations_on_source_role"
|
283
|
+
add_index "relations", ["target_role"], :name => "index_relations_on_target_role"
|
284
|
+
add_index "relations", ["site_id"], :name => "index_relations_on_site_id"
|
285
|
+
|
286
|
+
# ============================================ roles (virtual_classes)
|
287
|
+
execute "RENAME TABLE virtual_classes TO roles"
|
288
|
+
execute "ALTER TABLE roles COLLATE utf8_unicode_ci"
|
289
|
+
execute "ALTER TABLE roles MODIFY `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL"
|
290
|
+
execute "ALTER TABLE roles MODIFY `kpath` VARCHAR(16) COLLATE utf8_unicode_ci DEFAULT NULL"
|
291
|
+
execute "ALTER TABLE roles MODIFY `real_class` VARCHAR(16) COLLATE utf8_unicode_ci DEFAULT NULL"
|
292
|
+
execute "ALTER TABLE roles MODIFY `icon` VARCHAR(200) COLLATE utf8_unicode_ci DEFAULT NULL"
|
293
|
+
# new
|
294
|
+
add_column :roles, :type, :string
|
295
|
+
add_column :roles, :created_at, :datetime
|
296
|
+
add_column :roles, :updated_at, :datetime
|
297
|
+
add_column :roles, :properties, :text
|
298
|
+
|
299
|
+
# idx
|
300
|
+
add_index "roles", ["name"], :name => "index_roles_on_name"
|
301
|
+
add_index "roles", ["kpath"], :name => "index_roles_on_kpath"
|
302
|
+
add_index "roles", ["site_id"], :name => "index_roles_on_site_id"
|
303
|
+
|
304
|
+
# ============================================ schema_migrations
|
305
|
+
execute "ALTER TABLE schema_migrations COLLATE utf8_unicode_ci"
|
306
|
+
execute "ALTER TABLE schema_migrations MODIFY `version` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL"
|
307
|
+
execute "ALTER TABLE schema_migrations MODIFY `brick` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL"
|
308
|
+
|
309
|
+
# ============================================ sessions
|
310
|
+
execute "ALTER TABLE sessions COLLATE utf8_unicode_ci"
|
311
|
+
execute "ALTER TABLE sessions MODIFY `session_id` VARCHAR(255) COLLATE utf8_unicode_ci NOT NULL"
|
312
|
+
execute "ALTER TABLE sessions MODIFY `data` TEXT COLLATE utf8_unicode_ci NOT NULL"
|
313
|
+
|
314
|
+
# ============================================ sites
|
315
|
+
execute "ALTER TABLE sites COLLATE utf8_unicode_ci"
|
316
|
+
execute "ALTER TABLE sites MODIFY `host` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL"
|
317
|
+
execute "ALTER TABLE sites MODIFY `host` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL"
|
318
|
+
execute "ALTER TABLE sites MODIFY `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL"
|
319
|
+
execute "ALTER TABLE sites MODIFY `languages` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL"
|
320
|
+
execute "ALTER TABLE sites MODIFY `default_lang` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL"
|
321
|
+
|
322
|
+
remove_column :sites, :su_id
|
323
|
+
add_column :sites, :properties, :text
|
324
|
+
add_column :sites, :api_group_id, :integer
|
325
|
+
add_column :sites, :roles_updated_at, :datetime
|
326
|
+
|
327
|
+
add_index "sites", ["host"], :name => "index_sites_on_host"
|
328
|
+
|
329
|
+
# ============================================ stored_columns
|
330
|
+
create_table "stored_columns", :force => true do |t|
|
331
|
+
t.integer "stored_role_id"
|
332
|
+
t.string "name"
|
333
|
+
t.string "ptype"
|
334
|
+
end
|
335
|
+
|
336
|
+
# ============================================ users
|
337
|
+
execute "ALTER TABLE users COLLATE utf8_unicode_ci"
|
338
|
+
execute "ALTER TABLE users MODIFY `login` VARCHAR(20) COLLATE utf8_unicode_ci DEFAULT NULL"
|
339
|
+
execute "ALTER TABLE users MODIFY `crypted_password` VARCHAR(40) COLLATE utf8_unicode_ci DEFAULT NULL"
|
340
|
+
execute "ALTER TABLE users MODIFY `time_zone` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL"
|
341
|
+
execute "ALTER TABLE users MODIFY `lang` VARCHAR(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT ''"
|
342
|
+
execute "ALTER TABLE users MODIFY `password_salt` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL"
|
343
|
+
execute "ALTER TABLE users MODIFY `persistence_token` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL"
|
344
|
+
execute "ALTER TABLE users MODIFY `single_access_token` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL"
|
345
|
+
|
346
|
+
rename_column :users, :contact_id, :node_id
|
347
|
+
|
348
|
+
add_column :users, :properties, :text
|
349
|
+
|
350
|
+
# ============================================ versions
|
351
|
+
execute "DROP INDEX index_versions_on_title_and_text_and_summary ON versions" rescue nil
|
352
|
+
execute "ALTER TABLE versions ENGINE=InnoDB COLLATE utf8_unicode_ci"
|
353
|
+
execute "ALTER TABLE versions MODIFY `type` VARCHAR(32) COLLATE utf8_unicode_ci DEFAULT NULL"
|
354
|
+
execute "ALTER TABLE versions MODIFY `node_id` INT(11) NOT NULL"
|
355
|
+
execute "ALTER TABLE versions MODIFY `user_id` INT(11) NOT NULL"
|
356
|
+
execute "ALTER TABLE versions MODIFY `lang` VARCHAR(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT ''"
|
357
|
+
|
358
|
+
# Version is not inherited anymore
|
359
|
+
remove_column(:versions, :type) rescue nil
|
360
|
+
|
361
|
+
remove_index :versions, :column => [:title, :text, :summary]
|
362
|
+
|
363
|
+
execute "ALTER TABLE versions MODIFY `comment` TEXT COLLATE utf8_unicode_ci"
|
364
|
+
|
365
|
+
rename_column :versions, :title, :idx_text_high
|
366
|
+
execute "ALTER TABLE versions MODIFY `idx_text_high` TEXT COLLATE utf8_unicode_ci"
|
367
|
+
|
368
|
+
rename_column :versions, :summary, :idx_text_medium
|
369
|
+
execute "ALTER TABLE versions MODIFY `idx_text_medium` TEXT COLLATE utf8_unicode_ci"
|
370
|
+
|
371
|
+
rename_column :versions, :text, :idx_text_low
|
372
|
+
execute "ALTER TABLE versions MODIFY `idx_text_low` TEXT COLLATE utf8_unicode_ci"
|
373
|
+
|
374
|
+
execute "ALTER TABLE versions MODIFY `status` INT(11) NOT NULL"
|
375
|
+
|
376
|
+
# LONGTEXT
|
377
|
+
add_column :versions, :properties, :text, :limit => 2147483647
|
378
|
+
add_column :versions, :attachment_id, :integer
|
379
|
+
|
380
|
+
add_index "versions", ["node_id"], :name => "index_versions_on_node_id"
|
381
|
+
add_index "versions", ["user_id"], :name => "index_versions_on_user_id"
|
382
|
+
|
383
|
+
# ============================================ zips
|
384
|
+
execute "ALTER TABLE zips COLLATE utf8_unicode_ci"
|
385
|
+
|
386
|
+
add_index "zips", ["site_id"], :name => "index_zips_on_site_id"
|
387
|
+
end
|
388
|
+
end
|