-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add anonymous_access_codes and execute its install steps (#294)
* Add anonymous_access_codes and execute its install steps * Fix reviewdog comments
- Loading branch information
Showing
8 changed files
with
1,022 additions
and
398 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
19 changes: 19 additions & 0 deletions
19
db/migrate/20240625091112_create_decidim_anonymous_codes_groups.decidim_anonymous_codes.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,19 @@ | ||
# frozen_string_literal: true | ||
# This migration comes from decidim_anonymous_codes (originally 20240403091336) | ||
|
||
class CreateDecidimAnonymousCodesGroups < ActiveRecord::Migration[6.1] | ||
def change | ||
create_table :decidim_anonymous_codes_groups do |t| | ||
t.jsonb :title | ||
|
||
t.datetime :expires_at | ||
t.boolean :active, default: true, null: false | ||
t.integer :max_reuses, default: 1, null: false | ||
t.integer :tokens_count, default: 0, null: false | ||
t.references :resource, polymorphic: true, null: true, index: { name: "decidim_anonymous_codes_groups_on_resource" } | ||
t.references :decidim_organization, null: false, foreign_key: true, index: { name: "decidim_anonymous_codes_groups_on_organization" } | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
15 changes: 15 additions & 0 deletions
15
db/migrate/20240625091113_create_decidim_anonymous_codes_tokens.decidim_anonymous_codes.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,15 @@ | ||
# frozen_string_literal: true | ||
# This migration comes from decidim_anonymous_codes (originally 20240403091356) | ||
|
||
class CreateDecidimAnonymousCodesTokens < ActiveRecord::Migration[6.1] | ||
def change | ||
create_table :decidim_anonymous_codes_tokens do |t| | ||
t.string :token, null: false | ||
t.integer :usage_count, default: 0, null: false | ||
|
||
t.references :group, null: false, index: { name: "decidim_anonymous_codes_tokens_on_group" } | ||
t.index [:token, :group_id], name: "index_anonymous_codes_token_group_uniqueness", unique: true | ||
t.timestamps | ||
end | ||
end | ||
end |
12 changes: 12 additions & 0 deletions
12
.../20240625091114_create_decidim_anonymous_codes_token_resources.decidim_anonymous_codes.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,12 @@ | ||
# frozen_string_literal: true | ||
# This migration comes from decidim_anonymous_codes (originally 20240403091376) | ||
|
||
class CreateDecidimAnonymousCodesTokenResources < ActiveRecord::Migration[6.1] | ||
def change | ||
create_table :decidim_anonymous_codes_token_resources do |t| | ||
t.references :token, null: false, index: { name: "decidim_anonymous_codes_token_resources_on_token" } | ||
t.references :resource, polymorphic: true, null: false, index: { name: "decidim_anonymous_codes_token_resources_on_resource" } | ||
t.timestamps | ||
end | ||
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
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
Oops, something went wrong.