-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attachments - Policy and Service updates for Group and Project attach…
…ments (#752) * start group and projects attachments * add policies to create service, remove controller and routes for now * add migration for attachments_updated_at column to namespace table * add service tests for policy * add policy and destroy tests * cleanup * fix tests * readd schema changes after rebase * fix create activity in attachment destroy service * add fix to projects sidebar * add db trigger and migration to exclude attachments_updated_at for namespaceS * reset log data tests
- Loading branch information
1 parent
acbb983
commit 4640a3d
Showing
23 changed files
with
358 additions
and
37 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
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
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
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
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
8 changes: 8 additions & 0 deletions
8
db/migrate/20240912152940_add_attachments_updated_at_to_namespace.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,8 @@ | ||
# frozen_string_literal: true | ||
|
||
# Migration to add attachments_updated_at column to namespaces table | ||
class AddAttachmentsUpdatedAtToNamespace < ActiveRecord::Migration[7.2] | ||
def change | ||
add_column :namespaces, :attachments_updated_at, :datetime | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
db/migrate/20240912193934_modify_namespaces_logidze_trigger_v03.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,8 @@ | ||
# frozen_string_literal: true | ||
|
||
# Migration to modify namespace logidze trigger for attachments_updated_at | ||
class ModifyNamespacesLogidzeTriggerV03 < ActiveRecord::Migration[7.2] | ||
def change | ||
update_trigger :logidze_on_namespaces, on: :namespaces, version: 3 | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,6 @@ | ||
CREATE OR REPLACE TRIGGER "logidze_on_namespaces" | ||
BEFORE UPDATE OR INSERT ON "namespaces" FOR EACH ROW | ||
WHEN (coalesce(current_setting('logidze.disabled', true), '') <> 'on') | ||
-- Parameters: history_size_limit (integer), timestamp_column (text), filtered_columns (text[]), | ||
-- include_columns (boolean), debounce_time_ms (integer) | ||
EXECUTE PROCEDURE logidze_logger(null, 'updated_at', '{created_at,metadata_summary,updated_at,attachments_updated_at}'); |
Oops, something went wrong.