-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(CE): add catalog and schedule sync resources (#511)
Co-authored-by: TivonB-AI2 <[email protected]>
- Loading branch information
1 parent
aeba32e
commit 96d6478
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
server/db/data/20241204154833_add_catalog_and_schedule_sync_resources.rb
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,28 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddCatalogAndScheduleSyncResources < ActiveRecord::Migration[7.1] | ||
def up | ||
new_resources_data = [ | ||
{ | ||
resources_name: "catalog", | ||
permissions: %w[create read update delete] | ||
}, | ||
{ | ||
resources_name: "schedule_sync", | ||
permissions: %w[create read update delete] | ||
} | ||
] | ||
|
||
new_resources_data.each do |resource_data| | ||
resource = Resource.create!( | ||
resources_name: resource_data[:resources_name], | ||
permissions: resource_data[:permissions] | ||
) | ||
puts "Resource '#{resource.resources_name}' created successfully with permissions: #{resource.permissions}" | ||
end | ||
end | ||
|
||
def down | ||
Resource.where(resources_name: %w[catalog schedule_sync]).destroy_all | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# frozen_string_literal: true | ||
|
||
DataMigrate::Data.define(version: 20_241_127_103_943) | ||
DataMigrate::Data.define(version: 20_241_204_154_833) |