View Source Glific.Seeds.SeedsMigration (Glific v5.1.6)
One shot migration of data to add simulators and saas admin. We use the functions in this file to add simulators for new organizations as they are created
Link to this section Summary
Functions
Add a saas user for the organization. We need to check if it already exists since this code is used during data migration and can be repeated for the same organization
Reset message number for a list of organizations or for a org_id
Reset message number for a list of organizations or for a contact id
Public interface to do a seed migration across all organizations.
Create default organization roles for an organization
sync all the hsm from BSP to Glific DB
Sync bigquery schema with local db changes.
Link to this section Functions
@spec add_saas_user(Glific.Partners.Organization.t(), Glific.Settings.Language.t()) :: :ok
Add a saas user for the organization. We need to check if it already exists since this code is used during data migration and can be repeated for the same organization
Reset message number for a list of organizations or for a org_id
@spec fix_message_number_for_contact(integer()) :: :ok
Reset message number for a list of organizations or for a contact id
@spec migrate_data(atom(), Glific.Partners.Organization.t() | nil) :: :ok
Public interface to do a seed migration across all organizations.
One function to rule them all. This function is invoked manually by a glific developer to add data from the DB. This seems the cleanest way to do such things. We use phases to separate different migrations
@spec set_default_organization_roles(non_neg_integer()) :: Glific.AccessControl.Role.t()
Create default organization roles for an organization
@spec sync_hsm_templates(list()) :: :ok
sync all the hsm from BSP to Glific DB
@spec sync_schema_with_bigquery(list()) :: :ok
Sync bigquery schema with local db changes.