Skip to content

Commit

Permalink
chore(CE): add catalog and schedule sync resources (#511)
Browse files Browse the repository at this point in the history
Co-authored-by: TivonB-AI2 <[email protected]>
  • Loading branch information
github-actions[bot] and TivonB-AI2 authored Dec 5, 2024
1 parent aeba32e commit 96d6478
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion server/db/data_schema.rb
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)

0 comments on commit 96d6478

Please sign in to comment.