-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Populate site_imports from sites.imported_data in CE (#4155)
* populate site_imports from sites.imported_data in CE * not dry_run? * Wrap data migration using `with_repo` to ensure ClickhouseRepo is running * Do not create funnels in seeds when running CE * Remove migrator wrapper * Explicitly raise on rollback attempt * Put a warning in data migration scripts which are put in migrations --------- Co-authored-by: Adrian Gruntkowski <[email protected]>
- Loading branch information
1 parent
55dfe4c
commit dc7243f
Showing
4 changed files
with
31 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
priv/repo/migrations/20240528115149_migrate_site_imports.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
defmodule Plausible.Repo.Migrations.MigrateSiteImports do | ||
use Plausible | ||
use Ecto.Migration | ||
|
||
def up do | ||
if ce?() do | ||
Plausible.DataMigration.SiteImports.run(dry_run?: false) | ||
end | ||
end | ||
|
||
def down do | ||
raise "Irreversible" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters