Commit d4a09227 authored by Mario Manno's avatar Mario Manno Committed by Mario Manno

pentabarf import: importing events and more

parent 9e32cc48
# frab - pentabarf import
These notes may help to import data from a pentabarf postgresql database.
Using postgresql as a database for frab is still somewhat untested. The pentabarf
import is however likely to fail, as pentabarf uses text fields instead of char(255)
## postgresql installation
install postgresql
## postgresql setup
make it listen on localhost
create a psql user and grant some access on relations
add a pentabarf entry for the postgresql database to your environment
* Make it listen on localhost
* create a psql user and grant some access on relations
* add a pentabarf entry for the postgresql database to your rails db environment
## postgresql copy
Make a copy of your postgresql database, as we need to do some changes
pg_dump -Fc DBNAME > backup.dump
......@@ -19,12 +25,28 @@ Make a copy of your postgresql database, as we need to do some changes
## postgresql permissions
Grant all permissions on the database copy to the import user account:
psql cccv
select 'grant all on '||schemaname||'.'||tablename||' to bar;' from pg_tables
order by schemaname, tablename;
## data migration
I had to delete some images, too.
-- conference acronyms appear in URLs, they may not contain whitespace in frab:
UPDATE conference SET acronym = replace(acronym, ' ', '');
UPDATE conference SET acronym = 'mrmcdX' where conference_id=86; -- mrmcdⅩ
## import
Delete any old mappings from previous imports. Maybe delete the old filess, too.
rm tmp/*mappings.yml
rm -fr public/system
RAILS_ENV=production rake db:reset
RAILS_ENV=production rake pentabarf:import:all
......@@ -164,7 +164,7 @@ class Event < ActiveRecord::Base
Conflict.create(:event => conflicting_event, :conflicting_event => self, :conflict_type => "events_overlap", :severity => "fatal")
end
end
self.event_people.group(:person_id).each do |event_person|
self.event_people.group(:person_id,:id).each do |event_person|
unless event_person.available_between?(self.start_time, self.end_time)
Conflict.create(:event => self, :person => event_person.person, :conflict_type => "person_unavailable", :severity => "warning")
end
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment