Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 15
- Log:
Attempt to update Typo to a Typo SVN HEAD release from around the
time the prototype installation was set up on the RISC OS Open Limited
web site. Timestamps place this at 04-Jul so a revision from 05-Jul or
earlier was pulled and copied over the 2.6.0 tarball stable code.
- Author:
- adh
- Date:
- Sat Jul 22 23:27:35 +0100 2006
- Size:
- 1550 Bytes
1 | class MoveTextFilterToTextFilterId < ActiveRecord::Migration |
2 | class BareArticle < ActiveRecord::Base |
3 | include BareMigration |
4 | end |
5 | |
6 | class BarePage < ActiveRecord::Base |
7 | include BareMigration |
8 | end |
9 | |
10 | class BareTextFilter < ActiveRecord::Base |
11 | include BareMigration |
12 | end |
13 | |
14 | def self.up |
15 | STDERR.puts "Converting Article and Page to use text_filter_id instead of text_filter" |
16 | id_of = BareTextFilter.find(:all).inject({}) {|h, f| h.merge({ h[f.name] => f.id }) } |
17 | |
18 | modify_tables_and_update([:add_column, BareArticle, :text_filter_id, :integer], |
19 | [:add_column, BarePage, :text_filter_id, :integer]) do |
20 | (BareArticle.find(:all) + BarePage.find(:all)).each do |content| |
21 | content.text_filter_id = id_of[content.attributes['text_filter']] |
22 | content.save! |
23 | end |
24 | end |
25 | remove_column :articles, :text_filter |
26 | remove_column :pages, :text_filter |
27 | end |
28 | |
29 | def self.down |
30 | STDERR.puts "Dropping text_filter_id in favor of text_filter" |
31 | name_of = BareTextFilter.find(:all).inject({}) {|h, f| h.merge({ h[f.id] => f.name })} |
32 | |
33 | modify_tables_and_update([:add_column, BareArticle, :text_filter, :string], |
34 | [:add_column, BarePage, :text_filter, :string]) do |
35 | (BareArticle.find(:all) + BarePage.find(:all)).each do |content| |
36 | content.attributes['text_filter'] = name_of[content.text_filter_id] |
37 | content.save! |
38 | end |
39 | end |
40 | remove_column :articles, :text_filter_id |
41 | remove_column :pages, :text_filter_id |
42 | end |
43 | end |