Releases: sjacorg/bayanat
bayanat v2.4.0
New Features
- Archiving evidence: utilize
yt-dlp
to archive video evidence from popular websites. The feature allows users to import files from the web into Bayanat. The users needs to be authorized by an administrators and a list of allowed websites can be added from the system settings, along with proxy settings. Admins can check the status of imported items from the Media Import Log dashboard. - Editable Locations Admin Levels: allows the administrators to add or delete administrative levels to match the target country. The order of the levels in the full location can also now be changes, again to allow for matching the target country.
- Editable Potential and Claimed Violation Categories: these two lists are now customization from the Component Data dashboard.
- Add Audio Playback Support: an audio player will allow users to play audio files attached to items directly from Bayanat without the need to download the files. Administrators still need to allow upload of audio files.
- Reauth and Verify popup: a popup will allow the user to re-authenticate when they lose their session while working (e.g. working for a long time on an item, after which the system logs them out for inactivity). This will prevent the users from losing their work in such scenarios. The popup will also appear when the user attempts an action that requires strong authentication.
- Add Tags to Actors: users can now add free tags when editing Actors.
Improvements
- Move force reset from System Settings to Users dashboard.
- Tweak user permissions terminology in the User card to make them simpler to understand.
- Fix long text overflow in preview drawers.
- Minor improvements to search.
- Include Actor Profiles in Actor CSV exports.
- Make PDF a default export format.
- Add an option to load default system settings.
- Add a confirmation message for deleting an event in Incidents.
- Add frontend validations for Actor columns.
- Invoke webauthn immediately after login when active.
- Rename all instances of Ref/Refs to Tag/Tags.
- Prioritize video files in Media section.
- UI/UX improvements to 2FA pages.
- UI/UX improvements to System Setting dashboard.
- Client-side sorting in System Log dashboard.
- Remove webauthn settings from System Setting, allow by default.
- Other improvements to UI/UX.
Bug Fixes
- Fix a bug that prevented Actor type search.
- Fix a bug that prevented Sources of Actor profiles from appearing in related Actor results.
- Fix a bug that caused props warning when dragging chips in Sheets Import.
- Fix a bug in validations on switch Actor types in Sheets Import.
- Fix a bug that caused multiple log entries of the same event.
- Fix a bug that caused the data table not to reset to first page when a new search is carried.
- Fix a bug that caused inconsistent results when searching for refs/tags in Bulletins.
- Fix a bug in CSV file import code.
- Fix a bug that caused Actor relationship information to be hidden.
- Fix a bug that caused focus issues with dialogs and TinyMCE.
- Fix bugs in export dashboard and card.
- Fix a bug that prevented file paths in source links.
- Fix a bug that prevented the application of max file size setting in media import dashboard.
Other
- Fix typos in frontend strings.
- Minimal Sqlalchemy2.x / Flask-sqlalchemy3.x Upgrade
- Simplified models structure, moving models into their own files.
- Phase out legacy Pydantic remnants.
- Update requirements.
Please ensure the Bayanat database, config.js
and the .env
files are backed up before beginning this upgrade.
This version brings Bayanat to compatibility with Ubuntu 24.04.
After stopping all Bayanat services, carefully follow the following steps to upgrade to this version:
-
Upgrade deps:
source env/bin/activate pip install -r requirements.txt
-
Database migrations:
-
Admin Levels table migrations:
BEGIN; ALTER TABLE location_admin_level ADD COLUMN display_order INTEGER; UPDATE location_admin_level SET code = new_values.new_code, display_order = new_values.new_code FROM ( SELECT id, ROW_NUMBER() OVER (ORDER BY code, id) AS new_code FROM location_admin_level ) new_values WHERE location_admin_level.id = new_values.id; ALTER TABLE location_admin_level ADD CONSTRAINT location_admin_level_code_key UNIQUE (code); COMMIT;
-
Migration for User web import permission:
ALTER TABLE "user" ADD COLUMN IF NOT EXISTS can_import_web BOOLEAN DEFAULT FALSE;
-
Migration for the bug fix in ref in Bulletins:
UPDATE bulletin SET ref = '{}' WHERE ref IS NULL; ALTER TABLE bulletin ALTER COLUMN ref SET DEFAULT '{}'; ALTER TABLE bulletin ALTER COLUMN ref SET NOT NULL;
-
Migration for adding tags to Actor:
ALTER TABLE actor ADD COLUMN tags VARCHAR[] DEFAULT '{}' NOT NULL;
-
Migration for renaming refs to tags in Bulletin:
ALTER TABLE bulletin RENAME COLUMN ref TO tags;
-
Check all migrations are successful:
flask check-db-alignment
-
-
Restart services.
What's Changed
NOTE: These PRs were completed on a private repository prior to the move to this public one.
- Experimental search improvements by @tarekio in #542
- Merge master into prod by @tarekio in #545
- Minimal Sqlalchemy2.x / Flask-sqlalchemy3.x Upgrade by @level09 in #489
- Simplified Models structure by @level09 in #503
- Move force reset from sys settings to users by @tarekio in #512
- Make Admin-Levels Editable by @cango91 in #505
- Make PV/CV editable on the component-data dashboard by @cango91 in #491
- Bugfix: Actor Type Search by @cango91 in #548
- Resolve Import bugs (Country / Ethnography) in Actors by @level09 in #549
- Incidents: No confirmation message for deleting an event by @apodacaduron in #551
- Sheets Import: Props warning when dragging chips by @apodacaduron in #552
- Sheets Import: fix validations on switch actor types by @apodacaduron in #553
- Fix Missing Person Details by @cango91 in #534
- Show
Sources
in<actor-result>
Components by @cango91 in #493 - Export Actor Profiles as CSV by @cango91 in #559
- Reauth popup by @apodacaduron in #560
- Fix typo in translation by @apodacaduron in #567
- Add FE validations for Actor columns by @apodacaduron in #562
- Update and sync package-lock file by @level09 in #565
- Fix missing color prop on switch by @apodacaduron in #571
- Fix duplicate logs 🪵 by @cango91 in #544
- Add export format json to configs - 2 by @apodacaduron in #569
- docker version pinning by @tarekio in #588
- Add Audio Playback Support by @cango91 in #535
v-data-table-server
sync fix by @cango91 in #584- Improve user permission names by @apodacaduron in #572
- Invoke webauthn immediately after login by @apodacaduron in #576
- Upgrade all dependencies to the max compatible version possible by @level09 in #563
- Reauth popup 2fa support by @apodacaduron in #577
- PDF Export: export all profile descriptions by @cango91 in #536
- Actors Validation Fix: # Children by @cango91 in #554
- Add an Option to load default system settings ↩️ by @cango91 in #543
- Phase Out Legacy Pydantic Remnants by @cango91 in #566
- PreviewCard: Fix long text overflow by @apodacaduron in #587
- Archiving evidence by @level09 in #579
- Make reauth popup only listen to 401 requests by @apodacaduron in #595
- Remove webauthn setting by @tarekio in #593
- Adv Search Bugfix for Multiple Excluded Terms by @cango91 in #583
- Sort items per update_at by @tarekio in #603
- System Logs: Add client side table sorting by @apodacaduron in #597
- Advanced Search Bugfix: Ref inclusion/exclusion inconsistency by @cango91 in #594
- Upgrade all dependencies by @level09 in #608
- Integrate maxFilesize to media and sheets import dropzones by @level09 in #605
- Fix table sync (again) by @tarekio in #602
- Data Import Log dashboard is not responsive by @apodacaduron in #607
- Fix console warning "toDataUrl on HTMLCanvasElement" by @apodacaduron in #598
- Add validation to No of Children by @apodacaduron in #606
- Make system settings toolbar sticky by @apodacaduron in #570
- CSV export, improve code quality by @cango91 in #575
- Restore Default Config Command by @cango91 in #526
- Updates to user dialog and sidebar by @apodacaduron in #573
- Validation Fix: Allow Filepath for Source Link by @cango91 in #590
- Allow to go back to 2FA selector by @apodacaduron in #596
- Export card style broken and status not refreshing by @apodacaduron in #555
- Reauth popup breaks 2FA setup when 2FA is enforced by @apodacaduron in #613
- Validation improvements by @cango91 in #609
- make GOOGLE_MAPS_API_KEY optional by @tarekio in #616
- Fix error in config var name by @tarekio in #617
- Prioritize videos in media section by @apodacaduron in #582
- Locations: Fix focus retention in nested dialogs of TinyMCE editor by @apodacaduron in #581
- Labels are invisible in dark mode by @apodacaduron in #604
- Hide Number and Parent ID when not available by @apodacaduron in #585
- Verify popup by @apodacaduron in #578
- BYNT-587: Add tags to Actor by @cango91 in #610
- Tweak pre-commit config by @tarekio in #619
- Remove all references to webauthn by @tarekio in #600
- Warnings in the import log dashboard by @apodacaduron in #615
- Incidents to actor relation is not show in the actor preview card by @apodacaduron in #614
- CSV Import Bugfix: Reset correct seq_id by @cango91 in #589
- BYNT-1312: change all references to ref/refs for bulletins by @cango91 in #612
- BYNT-1325: Centralize URL valida...
bayanat v2.2.4
- Fix a bug in Media category serialization.
- Fix time validation issue in Media screenshots.
- Fix date validation bug.
- Update translations.
- Fix typos in strings.
- Upgrade requirements.
This is a minor version which brings bug fixes, update translations and upgrading requirements.
After stopping all Bayanat services and backing up the database, follow the following steps:
-
Upgrade deps:
source env/bin/activate pip install -r requirements.txt
-
Database migrations:
No database migrations required to upgrade to this version.
-
Restart services.
bayanat v2.2.0
- UI Setup Wizard: Bayanat now comes with a wizard that helps installer set up Bayanat before first use. The wizard will allow the installer to seamlessly create the first admin account, customize some settings to better match the country or context the users will be working on, set security policies and enable or disable important features. After the completion of the wizard, Bayanat will be ready to use and there will be some extra steps that the admin may need to further customize their Bayanat. These steps will be appear in the dashboard with guidance.
- Improvements to Actor dialog UI/UX.
- Improve UI of save button in Actors, Bulletins and Incidents.
- Improvements to System Settings dashboard UI/UX, improve help text.
- Redesign Media card; introduce UI/UX improvements, display more information about the media file.
- Changes to Media deduplication detection.
- Migrating deduplication dashboard to Vue3, improvements to UI/UX.
- Refactor the way relationship info is fetched from backend.
- Add more children search options to Actor.
- Allow export of embedded images in descriptions in PDF.
- Add copy to review dialog search fields.
- Enable full text search to Actor Profile columns, now possible when searching in Actors.
- Disallow duplicate files in Media upload dialog.
- Introduce backend permission checks for full history access.
- Add System Settings validations.
- Add tests for Access Control.
- Add tests for import endpoints.
- Changes to typehints to make them more readable.
- Move all Python print statements to logger.
- Upgrade to Pydantic 2.x.
- Upgrade to python 3.12.
- Upgrade requirements.
- Cleanup unneeded static files.
- Fix a bug which caused uploading or importing files with non-English characters to fail.
- Fix a bug in Sheet Import tool that prevent scrolling in last step.
- Fix a bug in Flask 404 and 500 error pages.
- Fix a bug in Component Data dashboard that prevented scrolling.
- Fix a bug in System Logs dashboard.
- Fix a bug in System Administration dashboard.
- Fix a bug that caused existing uploaded files to be cleared when uploading more files to the file upload dialog.
- Fix a bug in Sheet Import tool when using CSV file.
- Fix a bug in Sheet Import tool.
Please ensure the Bayanat database, config.js
and the .env
files are backed up before beginning this upgrade.
This version brings Bayanat to compatibility with Ubuntu 24.04.
After stopping all Bayanat services, carefully follow the following steps to upgrade to this version:
-
Upgrade deps:
source env/bin/activate pip install -r requirements.txt
-
Database migrations:
-
Media table migrations:
BEGIN; -- Step 1: Remove the existing unique constraint on etag ALTER TABLE media DROP CONSTRAINT IF EXISTS media_etag_key; -- Step 2: Add a new index on etag if it doesn't exist CREATE INDEX IF NOT EXISTS ix_media_etag ON media (etag); -- Step 3: Add a new partial unique constraint CREATE UNIQUE INDEX IF NOT EXISTS ix_media_etag_unique_not_deleted ON media (etag) WHERE deleted = FALSE; COMMIT;
-
Actor Profiles FTS migrations:
BEGIN; ALTER TABLE actor_profile ADD column search text generated always as ( id::text || ' ' || COALESCE(originid, '') || ' ' || COALESCE(description,'') || ' ' || COALESCE(source_link,'') ) stored; CREATE INDEX ix_actor_profile_search ON actor_profile USING gin (search gin_trgm_ops); COMMIT;
-
Check all migrations are successful:
flask check-db-alignment
-
-
Add
SETUP_COMPLETE=true
to yourconfig.json
file. If you havejq
, you can run the following:
mv config.json config.json.backup; jq '.SETUP_COMPLETE=true' config.json.backup > conf
8000
ig.json
You can also make this change manually.
- Restart services.
bayanat v2.1
- UI/UX improvements to cards, dialogs and data tables.
- UI/UX improvements to Sheets Import tool.
- Major rewrite of node visualization code.
- Enable administrators to revoke users two factor authentication devices.
- Improve session security and privacy by removing unneeded information from API response.
- Allow users to filter items using their own filters.
- Improvements to translations code
- Allow clearing of assignee and reviewer in bulk operations.
- Enforce to_date > from_date in Events.
- Remove absolute paths from system logs.
- Fix multiple bugs that restricted admin access to certain operations.
- Fix multiple bugs in items selection in data tables
- Fix multiple bugs that prevented media viewing in cards.
- Fix a bug that caused relationships to appear twice in preview cards.
- Fix a bug that prevented non-admin users from restricting items upon creation.
- Fix a bug in incident get route
- Fix a bug that caused some fields in Actor search to be hidden.
- Fix a bug in skin markings import
- Fix a bug in 'Filter related to' search buttons.
- Fix a bug in Location description edit box.
- Fix a bug in edit button handler in Actor card
- Fix a bug that caused geo location types to reset after reentering the advanced search dialog.
- Fix a bug in Location card map.
- Fix a bug in date fields in Incident advanced search.
- Fix a bug in Incident number of items in data table.
- Fix a bug in Incident form title.
- Fix a bug in date fields.
- Fix a bug that prevented incident card preview
- Fix a bug in Father and Mother name search fields in Actor.
- Fix a bug in adding refs from review dialog.
- Fix a bug in Location type and admin level search.
- Fix a bug in locations map visualization in the Bulletin card.
- Fix a bug in event map visualizations in Actor card.
- Fix cascading flashed messages upon sign.
- Hide delete location button from non-admin users.
- Fix multiple issues in validations.
- Improve tests coverage.
- Adding threat model.
- Migrate to PyPDF.
- Upgrade requirements.
This version brings lots of UI/UX improvements, bug fixes and minor new features.
After stopping all Bayanat services and backing up the database, follow the following steps:
-
Upgrade deps:
source env/bin/activate pip install -r requirements.txt
-
Database migrations:
No database migrations required to upgrade to this version.
-
Restart services.
bayanat v2.0
- Upgrade to Vue 3.4 and Vuetify 3.6 accompanied by big improvements to the user interface and experience.
- Moving user settings to a global drawer and rearranging.
- Improving the UI of security pages (password change, 2FA, etc.).
- Overall improvements to cards and dialogs and dark mode.
- Session management: This feature allows administrators to track and manage user's sessions.
- View current and past user sessions.
- Logout specific or all sessions of a user.
- Settings to dis/allow concurrent user sessions and retention period for the sessions data.
- Introducing validations to user input, improving security and data consistency. The validations cover most core Bayanat API endpoints.
- System Log dashboard:
- Administrators can track errors in their instances and report it to us easily.
- Log settings can be set in the
.env
file.
- Automatic backups:
- Backups can be saved locally or to an S3 bucket.
- Settings can be set set in the
.env
file for security purposes.
- Improvements to code quality, adding type hints.
- Adding API documentation and improving docstrings in back-end code.
- Fix a bug in Google Maps API key setting.
- Fix a bug in User Groups dashboard paging.
- Fix a bug which cause the 'No Access Groups' checkbox to be automatically checked.
- Separate tests from config.json and improving test coverage.
- Improving translations coverage and adding translations for Chinese (simplified and traditional).
- Upgrade dependencies.
- Remove Flask Cache.
Please ensure the Bayanat database, config.js
and the .env
files are backed up before beginning this upgrade.
After stopping all Bayanat services, carefully follow the following steps to upgrade to this version:
-
Upgrade deps:
source env/bin/activate pip install -r requirements.txt
-
Database migrations:
-
Session table migrations:
BEGIN; CREATE TABLE sessions ( id SERIAL PRIMARY KEY, user_id INTEGER NOT NULL, session_token VARCHAR(255) UNIQUE NOT NULL, ip_address VARCHAR(255), created_at TIMESTAMP DEFAULT current_timestamp, updated_at TIMESTAMP DEFAULT current_timestamp, deleted BOOLEAN, last_active TIMESTAMP, expires_at TIMESTAMP, meta JSON, is_active BOOLEAN DEFAULT TRUE, CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES "user" (id) ON DELETE CASCADE ); COMMIT;
-
Roles table migrations:
BEGIN; ALTER TABLE "role" DROP CONSTRAINT "role_name_key"; ALTER TABLE "role" ALTER COLUMN "name" DROP NOT NULL; WITH updated_rows AS ( UPDATE "role" SET "name" = concat('Custom_role_', id::text) WHERE "name" IS NULL RETURNING id ), max_id AS ( 8000 SELECT max(id) AS max FROM updated_rows ) SELECT setval(pg_get_serial_sequence('role','id'), COALESCE((SELECT max FROM max_id), 1)) WHERE EXISTS (SELECT * FROM max_id); ALTER TABLE "role" ALTER COLUMN name SET NOT NULL; ALTER TABLE "role" ADD CONSTRAINT "role_name_key" UNIQUE ("name"); COMMIT;
-
Check all migrations are successful:
flask check-db-alignment
-
-
Restart services.
bayanat v1.34.5
- Hotfix that adds permission checks to two system configuration API endpoints.
- Masking Google Client Secret and reCAPTCHA private key when serialized.
The affected endpoints are:
GET /admin/api/configuration
: Get serialized app configuration.PUT /admin/api/configuration
: Update the application configuration and reloads the app.
The two endpoints were missing the Flask Security @roles_required("Admin")
decorator which verifies the user has the Admin role. As a result, these two endpoints were accessible to logged in users without the Admin role. It was not possible to access these endpoint without logging in to Bayanat as they were protected by the @auth_required("session")
decorator on before_request
handler. Requests by a user without an Admin
role to these endpoints would have been logged.
We advise to upgrade to this version as soon as possible. This vulnerability affects Bayanat versions from v1.26 to v1.34.4.
To upgrade to this version from the previous version, simply pull the new code and restart services. To upgrade from a older version, you'll need to follow the upgrade steps for each version.
We'll provide steps on how to investigate misuse of this vulnerability shortly. Please contact us on support [at] bayanat [dot] org if you need assistance in upgrading to this version.
To investigate requests on GET /admin/api/configuration
, you can use the attached nginx_log_scanner.py
script. The script can read the nginx logs of the server and will filter suspicious requests to investigate further.
To investigate requests on PUT /admin/api/configuration
, you can check the app config versioning table in the database:
select * from app_config;
The table contains all versions of the app configuration as well as the IDs of users who carried out the changes.
bayanat v1.34.4
- Allow non-admin users to restrict items they create to their own access groups.
- Fix a bug in Activity search
- Fix a bug in screenshot uploads
- Upgrade tests with fake data generation
- Upgrade dependencies
- Pin Ubuntu version in GitHub actions and dockerfiles
After stopping all Bayanat services, carefully follow the following steps to upgrade to this version:
-
Upgrade deps:
source env/bin/activate pip install -r requirements.txt
-
Database migrations:
No database migrations required to upgrade to this version.
-
Restart services.
bayanat v1.34
- Actor Profiles: Complete overhaul of the Actor component and addition of Profiles to help analysts store information from multiple sources in one Actor, cutting down on duplication within the database and improving efficiency, while allowing for information from different sources to remain clearly separated.
- Move origin ID, description, labels, sources, source links, documentation date and publish date, as well as all missing persons fields, to a new component called Actor Profile.
- Profile can have one of three types:
- Normal.
- Missing Person: This type will contain fields from the normal profile in addition to missing persons fields.
- Main: Same fields as in normal profile. However, each Actor can have one main profile and this profile can be used to consolidate and verify information stored in all profiles.
- Every Actor can contain unlimited number of normal and MP Profiles and one main profile.
- Profiles can be deleted and duplicated to allow for speedy creation.
- Changes to the Actor component to make the fields more universal, improve input uniformity and efficiency:
- Change family status to dropdown list.
- Change dialect to dropdown list. Dialects can be created and managed in the Component Data dashboard.
- Split father and middle name to two separate fields.
- Remove date of birth, place of birth and place of residence and move existing data to events.
- Remove the need to re-enter full name of a person, will be generated from first, middle and last name.
- Move "number of children" from missing persons to Actor.
- Add shortcuts to auto fill first and last names for persons with unknown names.
- Activity monitor: Improving this tool to allow admins to create audit trail of all users actions in the database.
- Complete revamp of the UI.
- Add a search tool, allowing admins to filter actions by date, type, subject and/or user.
- Track more user actions.
- Add settings for Activity Monitor in the System Settings dashboard to allow admins to customize their instances:
- Setting for retention period (minimum is 90 days), after which activities will be automatically deleted.
- Settings to enable/disable logging of types of user actions.
- Sheets import:
- Changes in code to support sheets import after changes in Actor/Actor Profiles.
- More refactoring and improvements to code quality.
- Fix a bug in skin markings import.
- Remove unneeded languages setting from System Settings dashboard.
- Re-enable OAuth, disabling sign-up and allowing sign-ins from users already created by an admin only.
- Fix a bug that caused related items to appear multiple times in review dialogs.
- Fix a bug in user management dashboard that prevented opening of the navigation drawer.
- Fix a bug in upload to S3 bucket which prevented uploads.
- Fix bug in global default language setting.
- Upgrade requirements
- Tweak tests to accommodate the above changes.
- Change to automated tests in GitHub Action to build the Bayanat container instead of using pre-built images.
- New management command to check the local database alignment with the database models in the code.
Please ensure the Bayanat database, config.js
and the .env
files are backed up before beginning this upgrade.
After stopping all Bayanat services, carefully follow the following steps to upgrade to this version:
-
Upgrade deps:
source env/bin/activate pip install -r requirements.txt
-
Database migrations:
-
Migrate family status and dialects first:
BEGIN; -- Step 1: Update the description column UPDATE actor SET description = COALESCE(description, '') || '<br> <br> Family status: ' || COALESCE(family_status, '') where family_status != ''; UPDATE actor SET description = COALESCE(description, '') || '<br> <br> Family status (AR): ' || COALESCE(family_status_ar, '') where family_status_ar != ''; UPDATE actor SET description = COALESCE(description, '') || '<br> <br> Dialects: ' || COALESCE(dialects, '') where dialects != ''; UPDATE actor SET description = COALESCE(description, '') || '<br> <br> Dialects (AR): ' || COALESCE(dialects_ar, '') where dialects_ar != ''; -- Step 2: Drop the family_status and dialects columns if the update was successful ALTER TABLE actor DROP COLUMN family_status, DROP COLUMN family_status_ar, DROP COLUMN dialects, DROP COLUMN dialects_ar; ALTER TABLE actor ADD COLUMN IF NOT EXISTS family_status VARCHAR(255); COMMIT; BEGIN; CREATE TABLE dialects ( id SERIAL PRIMARY KEY, title VARCHAR NOT NULL, title_tr VARCHAR, created_at TIMESTAMP WITHOUT TIME ZONE DEFAULT (NOW() AT TIME ZONE 'UTC'), updated_at TIMESTAMP WITHOUT TIME ZONE DEFAULT (NOW() AT TIME ZONE 'UTC'), deleted BOOLEAN ); CREATE TABLE actor_dialects ( actor_id INTEGER, dialect_id INTEGER, PRIMARY KEY (actor_id, dialect_id), FOREIGN KEY (actor_id) REFERENCES actor(id), FOREIGN KEY (dialect_id) REFERENCES dialects(id) ); COMMIT;
-
Migrate father name. This will depend on the previous use of the Father/Middle Name column. Please choose one of the two following option:
a. If the column was used to store middle name information, create a new column for Father's Name:
BEGIN; -- Add father name as new columns ALTER TABLE actor ADD COLUMN IF NOT EXISTS father_name VARCHAR(255); ALTER TABLE actor ADD COLUMN IF NOT EXISTS father_name_ar VARCHAR(255); COMMIT;
b. If the column was used to store father's name information, rename existing column and create a new one for Middle Name:
BEGIN; -- ALTERNATIVE SCENARIO FOR DBS THAT USED THE COLUMN AS FATHER NAME ALTER TABLE actor RENAME COLUMN middle_name to father_name; ALTER TABLE actor RENAME COLUMN middle_name_ar to father_name_ar; ALTER TABLE actor ADD COLUMN IF NOT EXISTS middle_name VARCHAR(255); ALTER TABLE actor ADD COLUMN IF NOT EXISTS middle_name_ar VARCHAR(255); COMMIT;
-
Update the following columns:
-- Rename columns -- Note: These statements will fail if the columns do not exist. ALTER TABLE actor RENAME COLUMN actor_type TO type; ALTER TABLE actor RENAME COLUMN bio_children TO no_children; ALTER TABLE actor RENAME COLUMN national_id_card TO id_number;
-
Move data from Actor to Actor Profile. This will create a new Profile, link it to Actor, move the data from Actor to Profile, and delete columns in Actor:
BEGIN; CREATE TABLE actor_profile ( id SERIAL PRIMARY KEY, description TEXT, source_link VARCHAR(255), source_link_type BOOLEAN DEFAULT FALSE, publish_date TIMESTAMP, documentation_date TIMESTAMP, actor_id INTEGER REFERENCES actor(id), originid VARCHAR(255), mode INTEGER DEFAULT 1 NOT NULL, -- Fields from BaseMixin created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, deleted BOOLEAN ); INSERT INTO actor_profile (id, description, source_link, source_link_type, publish_date, documentation_date, actor_id, originid) SELECT id, description, source_link, source_link_type, publish_date, documentation_date, id, originid FROM actor; -- reset actor profile counter SELECT setval('actor_profile_id_seq', (SELECT MAX(id) FROM actor_profile)); -- Rename actor_id to actor_profile_id in actor_sources table ALTER TABLE actor_sources RENAME COLUMN actor_id TO actor_profile_id; -- Rename actor_id to actor_profile_id in actor_labels table ALTER TABLE actor_labels RENAME COLUMN actor_id TO actor_profile_id; -- Rename actor_id to actor_profile_id in actor_verlabels table ALTER TABLE actor_verlabels RENAME COLUMN actor_id TO actor_profile_id; -- migrate foreign key constraints -- actor_labels table ALTER TABLE actor_labels DROP CONSTRAINT IF EXISTS actor_labels_actor_id_fkey; ALTER TABLE actor_labels ADD CONSTRAINT actor_labels_actor_profile_id_fkey FOREIGN KEY (actor_profile_id) REFERENCES actor_profile(id); -- actor_sources table ALTER TABLE actor_sources DROP CONSTRAINT IF EXISTS actor_sources_actor_id_fkey; ALTER TABLE actor_sources ADD CONSTRAINT actor_sources_actor_profile_id_fkey FOREIGN KEY (actor_profile_id) REFERENCES actor_profile(id); -- actor_verlabels table ALTER TABLE actor_verlabels DROP CONSTRAINT IF EXISTS actor_verlabels_actor_id_fkey; ALTER TABLE actor_verlabels ADD CONSTRAINT actor_verlabels_actor_profile_id_fkey FOREIGN KEY (actor_profile_id) REFERENCES actor_profile(id); -- handle updated generated column (Search) -- drop old column ALTER TABLE actor DROP COLUMN IF EXISTS search; -- Add the new 'search' column as a computed column based on new structure ALTER TABLE actor ADD COLUMN search TEXT GENERATED ALWAYS AS ( (id)::text || ' ' || COALESCE(name...
-
bayanat v1.31
- Visualizing queries: graph visualizations can now be used to visualize results of queries instead of being restricted to one item at a time. Users will see a button
- Introducing tests. Check Contributing Guidelines for further information. Tests currently cover backend routes, we'll be add more in the next few months.
- Introducing restrictive access control mode: If activated by admin, all items will be restricted in the database by default. Users will be only able to access items they're explicitly given access to.
- Added default export expiry time setting to system settings.
- Added additional security to upload endpoints.
- Improvements to Docker compose, adding dev and test compose and using pre-built images to accelerate GitHub checks. Additionally, new improvements allow Bayanat to restart when new system settings are saved.
- Further improvements to localization and adding translations for Russian, Spanish and Farsi languages.
- Improvements to preview cards.
- Improvements to image viewer.
- Improvements to map popup.
- Improvements and small fixes in System Settings dashboard.
- Improving
gen-env.sh
script that help generate.env
files. - Fixed a bug in allowed media types, unified validations of extensions.
- Fixed a bug in export approval.
- Fixed a bug in GeoLocation types.
- Fixed multiple bugs in User Administration dashboard.
- Fixed a bug in peer review when the user attempted to add a ref to an item with none.
- Fixed a bug in description inline images preview.
- Fixed a bug in media player when the user attempted to play the video again after returning to the item.
- Fixed a bug in Actor date search fields.
- Fixed a bug in visualization when B2B relation type isn't specified.
- Remove tesseract bin setting from System Settings dashboard, moving back to .env
- Update
.env-sample
file. - Upgraded requirements.
The visualizations improvements included in this version were made possible by funding from the International Coalition of Sites of Conscience.
Please ensure the Bayanat database, config.js
and the .env
files are backed up before beginning this upgrade.
After stopping all Bayanat services, carefully follow the following steps to upgrade to this version:
-
Upgrade deps:
source env/bin/activate pip install -r requirements.txt
-
Database migrations:
No database migrations required to upgrade to this version.
-
Restart services.
bayanat 1.29.1
This version doesn't contain any changes to Bayanat. It only introduce formatting guidelines for Python and JS files, as well as formatting these files.
No upgrade steps are required for this version.