File: schema.rb

package info (click to toggle)
ruby-model-tokenizer 1.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 156 kB
  • sloc: ruby: 248; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 557 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module ModelTokenizer
  module Test
    class Schema < ActiveRecord::Migration[4.2]
      class << self
        def down
          drop_table :cars
        end

        def up
          # TODO: use schema version to avoid ugly hacks like this
          return if @done

          create_table :cars do |t|
            t.string :data
            t.string :token
          end

          create_table :trucks do |t|
            t.string :data
            t.string :token
          end
          
          @done = true
        end
      end
    end
  end
end