mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-17 11:54:22 +01:00
update setup instructions to fix non-creation of f_unaccent function
This commit is contained in:
parent
5783f82418
commit
1851ef9543
19
README.md
19
README.md
@ -122,9 +122,12 @@ In you only intend to run fab-manager on your local machine for testing purposes
|
|||||||
```
|
```
|
||||||
|
|
||||||
8. Build the database. You may have to follow the steps described in [the PostgreSQL configuration chapter](#setup-fabmanager-in-postgresql) before, if you don't already had done it.
|
8. Build the database. You may have to follow the steps described in [the PostgreSQL configuration chapter](#setup-fabmanager-in-postgresql) before, if you don't already had done it.
|
||||||
|
**Warning**: **NO NOT** run `rake db:setup` instead of these commands, as this will not run some required raw SQL instructions.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rake db:setup
|
rake db:create
|
||||||
|
rake db:migrate
|
||||||
|
rake db:seed
|
||||||
```
|
```
|
||||||
|
|
||||||
9. Create the pids folder used by Sidekiq. If you want to use a different location, you can configure it in `config/sidekiq.yml`
|
9. Create the pids folder used by Sidekiq. If you want to use a different location, you can configure it in `config/sidekiq.yml`
|
||||||
@ -325,7 +328,7 @@ Otherwise, please follow the official instructions on the project's website.
|
|||||||
<a name="setup-fabmanager-in-postgresql"></a>
|
<a name="setup-fabmanager-in-postgresql"></a>
|
||||||
### Setup the FabManager database in PostgreSQL
|
### Setup the FabManager database in PostgreSQL
|
||||||
|
|
||||||
Before running `rake db:setup`, you have to make sure that the user configured in [config/database.yml](config/database.yml.default) for the `development` environment exists.
|
Before running `rake db:create`, you have to make sure that the user configured in [config/database.yml](config/database.yml.default) for the `development` environment exists.
|
||||||
To create it, please follow these instructions:
|
To create it, please follow these instructions:
|
||||||
|
|
||||||
1. Run the PostgreSQL administration command line interface, logged as the postgres user
|
1. Run the PostgreSQL administration command line interface, logged as the postgres user
|
||||||
@ -355,19 +358,13 @@ To create it, please follow these instructions:
|
|||||||
ALTER ROLE sleede WITH CREATEDB;
|
ALTER ROLE sleede WITH CREATEDB;
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Then, create the fabmanager_development and fabmanager_test databases
|
4. Then, attribute a password to this user
|
||||||
|
|
||||||
```sql
|
|
||||||
CREATE DATABASE fabmanager_development OWNER sleede;
|
|
||||||
CREATE DATABASE fabmanager_test OWNER sleede;
|
|
||||||
```
|
|
||||||
|
|
||||||
5. To finish, attribute a password to this user
|
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
ALTER USER sleede WITH ENCRYPTED PASSWORD 'sleede';
|
ALTER USER sleede WITH ENCRYPTED PASSWORD 'sleede';
|
||||||
```
|
```
|
||||||
6. Finally, have a look at the [PostgreSQL Limitations](#postgresql-limitations) section or some errors will occurs preventing you from finishing the installation procedure.
|
|
||||||
|
5. Finally, have a look at the [PostgreSQL Limitations](#postgresql-limitations) section or some errors will occurs preventing you from finishing the installation procedure.
|
||||||
|
|
||||||
<a name="postgresql-limitations"></a>
|
<a name="postgresql-limitations"></a>
|
||||||
### PostgreSQL Limitations
|
### PostgreSQL Limitations
|
||||||
|
@ -29,21 +29,23 @@ class MigrateEventReducedAmountToPriceCategory < ActiveRecord::Migration
|
|||||||
|
|
||||||
def down
|
def down
|
||||||
pc = PriceCategory.find_by(name: I18n.t('price_category.reduced_fare'))
|
pc = PriceCategory.find_by(name: I18n.t('price_category.reduced_fare'))
|
||||||
EventPriceCategory.where(price_category_id: pc.id).each do |epc|
|
unless pc.nil?
|
||||||
epc.event.update_column(:reduced_amount, epc.amount)
|
EventPriceCategory.where(price_category_id: pc.id).each do |epc|
|
||||||
|
epc.event.update_column(:reduced_amount, epc.amount)
|
||||||
|
|
||||||
Reservation.where(reservable_type: 'Event', reservable_id: epc.event.id).each do |r|
|
Reservation.where(reservable_type: 'Event', reservable_id: epc.event.id).each do |r|
|
||||||
r.tickets.each do |t|
|
r.tickets.each do |t|
|
||||||
if t.event_price_category_id == epc.id
|
if t.event_price_category_id == epc.id
|
||||||
r.update_column(:nb_reserve_reduced_places, t.booked)
|
r.update_column(:nb_reserve_reduced_places, t.booked)
|
||||||
t.destroy!
|
t.destroy!
|
||||||
break
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
epc.destroy!
|
||||||
end
|
end
|
||||||
epc.destroy!
|
|
||||||
end
|
|
||||||
|
|
||||||
pc.destroy!
|
pc.destroy!
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -340,7 +340,9 @@ Copy the previously customized `nginx.conf.example` as `/home/core/fabmanager/co
|
|||||||
|
|
||||||
#### create/migrate/seed db
|
#### create/migrate/seed db
|
||||||
|
|
||||||
`docker-compose run --rm fabmanager bundle exec rake db:setup`
|
`docker-compose run --rm fabmanager bundle exec rake db:create`
|
||||||
|
`docker-compose run --rm fabmanager bundle exec rake db:migrate`
|
||||||
|
`docker-compose run --rm fabmanager bundle exec rake db:seed`
|
||||||
|
|
||||||
#### build assets
|
#### build assets
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user