mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2025-04-20 07:11:33 +02:00
Add importer model, validations to paper model
This commit is contained in:
parent
568abb631f
commit
46de026234
8 changed files with 67 additions and 13 deletions
|
@ -5,6 +5,7 @@ class CreatePapers < ActiveRecord::Migration
|
|||
t.string :url
|
||||
t.string :reference
|
||||
t.string :name
|
||||
t.string :body
|
||||
t.datetime :published_at
|
||||
t.datetime :scraped_at
|
||||
t.string :paper_type
|
||||
|
@ -14,5 +15,10 @@ class CreatePapers < ActiveRecord::Migration
|
|||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index(:papers, :reference)
|
||||
add_index(:papers, :originator)
|
||||
add_index(:papers, :body)
|
||||
add_index(:papers, [:reference, :body], unique: true)
|
||||
end
|
||||
end
|
||||
|
|
8
db/migrate/20150517152218_create_importers.rb
Normal file
8
db/migrate/20150517152218_create_importers.rb
Normal file
|
@ -0,0 +1,8 @@
|
|||
class CreateImporters < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :importers do |t|
|
||||
t.string :url
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue