Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Debezium Outbox support #1167

Merged
merged 10 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rbac/management/debezium/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# noqa
31 changes: 31 additions & 0 deletions rbac/management/debezium/model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Copyright 2019 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#

"""Debezium model for outbox messages."""
from uuid import uuid4

from django.db import models


class Outbox(models.Model):
"""Outbox Table for Debezium."""

id = models.UUIDField(primary_key=True, default=uuid4, editable=False)
aggregatetype = models.CharField(max_length=255)
aggregateid = models.CharField(max_length=255)
event_type = models.CharField(max_length=255, db_column="type")
payload = models.JSONField()
32 changes: 32 additions & 0 deletions rbac/management/migrations/0048_outbox.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 4.2.15 on 2024-08-21 17:38

from django.db import migrations, models
import uuid


class Migration(migrations.Migration):

dependencies = [
("management", "0047_rolemapping_rolev2_rolemapping_role_v2_rolebinding"),
]

operations = [
migrations.CreateModel(
name="Outbox",
fields=[
(
"id",
models.UUIDField(
default=uuid.uuid4,
editable=False,
primary_key=True,
serialize=False,
),
),
("aggregatetype", models.CharField(max_length=255)),
("aggregateid", models.CharField(max_length=255)),
("event_type", models.CharField(db_column="type", max_length=255)),
("payload", models.JSONField()),
],
),
]
1 change: 1 addition & 0 deletions rbac/management/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
from management.policy.model import Policy
from management.audit_log.model import AuditLog
from management.workspace.model import Workspace
from management.debezium.model import Outbox