forked from icl/elan_parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved annotation values out of alignable annotations due to bug with …
…time slot overlap
- Loading branch information
Aaron Hunter
committed
Mar 11, 2012
1 parent
0c1610e
commit 68dd7a2
Showing
7 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require 'active_record' | ||
|
||
module ElanParser | ||
module DB | ||
class AnnotationValue < ActiveRecord::Base | ||
self.table_name = 'elan_parser_annotation_values' | ||
|
||
has_many :alignable_annotations | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
lib/generators/elan_parser/annotation_fix/annotation_fix_generator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'rails/generators/migration' | ||
|
||
module ElanParser | ||
module Generators | ||
class AnnotationFixGenerator < ::Rails::Generators::Base | ||
include Rails::Generators::Migration | ||
source_root File.expand_path('../../templates', __FILE__) | ||
desc "Add the migrations" | ||
|
||
def self.next_migration_number(path) | ||
unless @prev_migration_nr | ||
@prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i | ||
else | ||
@prev_migration_nr += 1 | ||
end | ||
@prev_migration_nr.to_s | ||
end | ||
|
||
def copy_migrations | ||
migration_template "elan_parser_migration_to_06.rb", "db/migrate/elan_parser_migration_to_06.rb" | ||
end | ||
end | ||
end | ||
end |
15 changes: 15 additions & 0 deletions
15
lib/generators/elan_parser/templates/elan_parser_migration_to_06.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class ElanParserMigrationTo06 < ActiveRecord::Migration | ||
def self.up | ||
drop_table :elan_parser_alignable_annotations | ||
|
||
create_table :elan_parser_alignable_annotations do |t| | ||
t.column :svg_ref, :string | ||
t.column :ext_ref, :string | ||
t.belongs_to :annotation_value | ||
end | ||
|
||
create_table :elan_parser_annotation_values do |t| | ||
t.column :annotation_value, :text | ||
end | ||
end | ||
end |