-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Preferred Replica model and prefer those replicas when disc…
…overing replicas for shards
- Loading branch information
1 parent
1379d7a
commit 03f6874
Showing
4 changed files
with
52 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.contrib import admin | ||
|
||
from housewatch.models.preferred_replica import PreferredReplica | ||
|
||
|
||
admin.site.register(PreferredReplica) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 4.1.1 on 2024-05-29 16:34 | ||
|
||
from django.db import migrations, models | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('housewatch', '0011_scheduledbackup_is_sharded_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='PreferredReplica', | ||
fields=[ | ||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), | ||
('created_at', models.DateTimeField(auto_now_add=True)), | ||
('cluster', models.CharField(max_length=255)), | ||
('replica', models.CharField(max_length=255)), | ||
], | ||
), | ||
] |
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,9 @@ | ||
import uuid | ||
from django.db import models | ||
|
||
|
||
class PreferredReplica(models.Model): | ||
id: models.UUIDField = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) | ||
created_at: models.DateTimeField = models.DateTimeField(auto_now_add=True) | ||
cluster: models.CharField = models.CharField(max_length=255) | ||
replica: models.CharField = models.CharField(max_length=255) |