Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 71
- Log:
Start of upgrade to Typo 4.0.0, the latest stable release since
2.6.0. Note test/mocks/themes/azure changes from a file to a
directory, so the file has been removed in this revision and
the directory will be added in the next revision.
- Author:
- adh
- Date:
- Mon Aug 07 22:18:11 +0100 2006
- Size:
- 2402 Bytes
1 | class Bare23Content < ActiveRecord::Base |
2 | include BareMigration |
3 | set_inheritance_column :bogustype # see migration #20 for why |
4 | end |
5 | |
6 | class Bare23Page < ActiveRecord::Base |
7 | include BareMigration |
8 | end |
9 | |
10 | class SuperclassPages < ActiveRecord::Migration |
11 | def self.up |
12 | STDERR.puts "Merging Pages into Content table" |
13 | modify_tables_and_update(:add_column, Bare23Content, :name, :string) do |
14 | Bare23Content.transaction do |
15 | if not $schema_generator |
16 | Bare23Page.find(:all).each do |p| |
17 | Bare23Content.create(:type => 'Page', |
18 | :name => p.name, |
19 | :user_id => p.user_id, |
20 | :body => p.body, |
21 | :body_html => p.body_html, |
22 | :created_at => p.created_at, |
23 | :updated_at => (p.modified_at rescue p.updated_at), |
24 | :title => p.title, |
25 | :text_filter_id => p.text_filter_id) |
26 | end |
27 | end |
28 | end |
29 | end |
30 | drop_table :pages |
31 | end |
32 | |
33 | def self.init_pages(t) |
34 | t.column :name, :string |
35 | t.column :user_id, :integer |
36 | t.column :body, :text |
37 | t.column :body_html, :text |
38 | t.column :created_at, :datetime |
39 | t.column :updated_at, :datetime |
40 | t.column :title, :string |
41 | t.column :text_filter_id, :integer |
42 | t.column :whiteboard, :text |
43 | end |
44 | |
45 | def self.down |
46 | STDERR.puts "Recreating pages table" |
47 | modify_tables_and_update(:create_table, :pages, lambda {|t| init_pages(t)}) do |
48 | Bare23Content.transaction do |
49 | Bare23Content.find(:all, :conditions => "type = 'Page'").each do |p| |
50 | Bare23Page.create(:name => p.name, |
51 | :user_id => p.user_id, |
52 | :body => p.body, |
53 | :body_html => p.body_html, |
54 | :created_at => p.created_at, |
55 | :updated_at => p.updated_at, |
56 | :title => p.title, |
57 | :text_filter_id => p.text_filter_id, |
58 | :whiteboard => p.whiteboard) |
59 | end |
60 | Bare23Content.delete_all "type = 'Page'" |
61 | end |
62 | end |
63 | remove_column :contents, :name |
64 | end |
65 | end |