mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +01:00
Merge branch 'dev' for release 4.0.1
This commit is contained in:
commit
061dc882bd
@ -1,5 +1,12 @@
|
||||
# Changelog Fab Manager
|
||||
|
||||
## v4.0.1 2019 June 17
|
||||
|
||||
- Fix a bug: migration 20190523140823 may not run if an admin was deleted
|
||||
- Fix a bug: cookie consent modal is not shown
|
||||
- Fix a bug: prevent task migrate_pdf_invoices_folders from raising an error when run with no invoices
|
||||
- Documentation about dumping the database
|
||||
|
||||
## v4.0.0 2019 June 17
|
||||
|
||||
- Configurable privacy policy and data protection officer
|
||||
|
@ -51,7 +51,7 @@ Application.Controllers.controller('CookiesController', ['$scope', '$cookies', '
|
||||
}
|
||||
});
|
||||
// if the GA_ID environment variable was not set, only functional cookies will be set, so user consent is not required
|
||||
$scope.cookiesState = 'ignore';
|
||||
if (!Fablab.gaId) $scope.cookiesState = 'ignore';
|
||||
};
|
||||
|
||||
const readCookie = function () {
|
||||
|
@ -1,18 +1,18 @@
|
||||
class MigrateHistoryValueToInvoicingProfile < ActiveRecord::Migration
|
||||
def up
|
||||
HistoryValue.all.each do |hv|
|
||||
user = User.find(hv.user_id)
|
||||
user = User.find_by(id: hv.user_id)
|
||||
hv.update_attributes(
|
||||
invoicing_profile_id: user.invoicing_profile.id
|
||||
invoicing_profile_id: user&.invoicing_profile&.id
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
HistoryValue.all.each do |hv|
|
||||
invoicing_profile = User.find(hv.invoicing_profile_id)
|
||||
invoicing_profile = User.find_by(id: hv.invoicing_profile_id)
|
||||
hv.update_attributes(
|
||||
user_id: invoicing_profile.user_id
|
||||
user_id: invoicing_profile&.user_id
|
||||
)
|
||||
end
|
||||
end
|
||||
|
@ -17,6 +17,33 @@ This can be achieved doing the following:
|
||||
su postgres
|
||||
psql
|
||||
```
|
||||
|
||||
## Dumping the database
|
||||
|
||||
Use the following commands to dump the PostgreSQL database to an archive file
|
||||
```bash
|
||||
cd /apps/fabmanager/
|
||||
docker-compose exec postgres bash
|
||||
cd /var/lib/postgresql/data/
|
||||
pg_dump -U postgres fabmanager_production > fabmanager_production_$(date -I).sql
|
||||
tar cvzf fabmanager_production_$(date -I).tar.gz fabmanager_production_$(date -I).sql
|
||||
```
|
||||
|
||||
If you're connected to your server thought SSH, you can download the resulting dump file using the following:
|
||||
```bash
|
||||
scp root@remote.server.fab:/apps/fabmanager/postgresql/dump/fabmanager_production_$(date -I).tar.gz .
|
||||
```
|
||||
|
||||
Restore the dump with the following:
|
||||
```bash
|
||||
tar xvf fabmanager_production_$(date -I).tar.gz
|
||||
sudo cp fabmanager_production_$(date -I).sql .docker/postgresql/
|
||||
rake db:drop
|
||||
rake db:create
|
||||
docker exec -it fabmanager-postgres bash
|
||||
cd /var/lib/postgresql/data/
|
||||
psql -U postgres -d fabmanager_production -f fabmanager_production_$(date -I).sql
|
||||
```
|
||||
|
||||
<a name="postgresql-limitations"></a>
|
||||
## PostgreSQL Limitations
|
||||
|
@ -82,6 +82,8 @@ namespace :fablab do
|
||||
|
||||
desc 'migrate PDF invoices to folders numbered by invoicing_profile'
|
||||
task migrate_pdf_invoices_folders: :environment do
|
||||
puts 'No invoices, exiting...' and return if Invoice.count.zero?
|
||||
|
||||
require 'fileutils'
|
||||
Invoice.all.each do |i|
|
||||
invoicing_profile = i.invoicing_profile
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "fab-manager",
|
||||
"version": "4.0.0",
|
||||
"version": "4.0.1",
|
||||
"description": "FabManager is the FabLab management solution. It is web-based, open-source and totally free.",
|
||||
"keywords": [
|
||||
"fablab",
|
||||
|
Loading…
Reference in New Issue
Block a user