mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 19:11:12 -05:00
Add versioning system tables
This commit is contained in:
@@ -324,6 +324,279 @@ export type Database = {
|
||||
}
|
||||
Relationships: []
|
||||
}
|
||||
entity_field_history: {
|
||||
Row: {
|
||||
change_type: string
|
||||
created_at: string
|
||||
field_name: string
|
||||
id: string
|
||||
new_value: Json | null
|
||||
old_value: Json | null
|
||||
version_id: string
|
||||
}
|
||||
Insert: {
|
||||
change_type: string
|
||||
created_at?: string
|
||||
field_name: string
|
||||
id?: string
|
||||
new_value?: Json | null
|
||||
old_value?: Json | null
|
||||
version_id: string
|
||||
}
|
||||
Update: {
|
||||
change_type?: string
|
||||
created_at?: string
|
||||
field_name?: string
|
||||
id?: string
|
||||
new_value?: Json | null
|
||||
old_value?: Json | null
|
||||
version_id?: string
|
||||
}
|
||||
Relationships: [
|
||||
{
|
||||
foreignKeyName: "entity_field_history_version_id_fkey"
|
||||
columns: ["version_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "entity_versions"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
]
|
||||
}
|
||||
entity_relationships_history: {
|
||||
Row: {
|
||||
change_type: string
|
||||
created_at: string
|
||||
id: string
|
||||
old_related_entity_id: string | null
|
||||
related_entity_id: string | null
|
||||
related_entity_type: string
|
||||
relationship_type: string
|
||||
version_id: string
|
||||
}
|
||||
Insert: {
|
||||
change_type: string
|
||||
created_at?: string
|
||||
id?: string
|
||||
old_related_entity_id?: string | null
|
||||
related_entity_id?: string | null
|
||||
related_entity_type: string
|
||||
relationship_type: string
|
||||
version_id: string
|
||||
}
|
||||
Update: {
|
||||
change_type?: string
|
||||
created_at?: string
|
||||
id?: string
|
||||
old_related_entity_id?: string | null
|
||||
related_entity_id?: string | null
|
||||
related_entity_type?: string
|
||||
relationship_type?: string
|
||||
version_id?: string
|
||||
}
|
||||
Relationships: [
|
||||
{
|
||||
foreignKeyName: "entity_relationships_history_version_id_fkey"
|
||||
columns: ["version_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "entity_versions"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
]
|
||||
}
|
||||
entity_versions: {
|
||||
Row: {
|
||||
change_reason: string | null
|
||||
change_type: Database["public"]["Enums"]["version_change_type"]
|
||||
changed_at: string
|
||||
changed_by: string | null
|
||||
entity_id: string
|
||||
entity_type: string
|
||||
id: string
|
||||
ip_address_hash: string | null
|
||||
is_current: boolean
|
||||
metadata: Json | null
|
||||
submission_id: string | null
|
||||
version_data: Json
|
||||
version_number: number
|
||||
}
|
||||
Insert: {
|
||||
change_reason?: string | null
|
||||
change_type?: Database["public"]["Enums"]["version_change_type"]
|
||||
changed_at?: string
|
||||
changed_by?: string | null
|
||||
entity_id: string
|
||||
entity_type: string
|
||||
id?: string
|
||||
ip_address_hash?: string | null
|
||||
is_current?: boolean
|
||||
metadata?: Json | null
|
||||
submission_id?: string | null
|
||||
version_data: Json
|
||||
version_number: number
|
||||
}
|
||||
Update: {
|
||||
change_reason?: string | null
|
||||
change_type?: Database["public"]["Enums"]["version_change_type"]
|
||||
changed_at?: string
|
||||
changed_by?: string | null
|
||||
entity_id?: string
|
||||
entity_type?: string
|
||||
id?: string
|
||||
ip_address_hash?: string | null
|
||||
is_current?: boolean
|
||||
metadata?: Json | null
|
||||
submission_id?: string | null
|
||||
version_data?: Json
|
||||
version_number?: number
|
||||
}
|
||||
Relationships: [
|
||||
{
|
||||
foreignKeyName: "entity_versions_submission_id_fkey"
|
||||
columns: ["submission_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "content_submissions"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
]
|
||||
}
|
||||
historical_parks: {
|
||||
Row: {
|
||||
closure_reason: string | null
|
||||
created_at: string
|
||||
final_state_data: Json
|
||||
id: string
|
||||
location_id: string | null
|
||||
name: string
|
||||
operated_from: string | null
|
||||
operated_until: string | null
|
||||
original_park_id: string | null
|
||||
slug: string
|
||||
successor_park_id: string | null
|
||||
}
|
||||
Insert: {
|
||||
closure_reason?: string | null
|
||||
created_at?: string
|
||||
final_state_data: Json
|
||||
id?: string
|
||||
location_id?: string | null
|
||||
name: string
|
||||
operated_from?: string | null
|
||||
operated_until?: string | null
|
||||
original_park_id?: string | null
|
||||
slug: string
|
||||
successor_park_id?: string | null
|
||||
}
|
||||
Update: {
|
||||
closure_reason?: string | null
|
||||
created_at?: string
|
||||
final_state_data?: Json
|
||||
id?: string
|
||||
location_id?: string | null
|
||||
name?: string
|
||||
operated_from?: string | null
|
||||
operated_until?: string | null
|
||||
original_park_id?: string | null
|
||||
slug?: string
|
||||
successor_park_id?: string | null
|
||||
}
|
||||
Relationships: [
|
||||
{
|
||||
foreignKeyName: "historical_parks_location_id_fkey"
|
||||
columns: ["location_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "locations"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
{
|
||||
foreignKeyName: "historical_parks_original_park_id_fkey"
|
||||
columns: ["original_park_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "parks"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
{
|
||||
foreignKeyName: "historical_parks_successor_park_id_fkey"
|
||||
columns: ["successor_park_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "parks"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
]
|
||||
}
|
||||
historical_rides: {
|
||||
Row: {
|
||||
created_at: string
|
||||
final_state_data: Json
|
||||
id: string
|
||||
name: string
|
||||
operated_from: string | null
|
||||
operated_until: string | null
|
||||
original_ride_id: string | null
|
||||
park_id: string | null
|
||||
relocated_to_park_id: string | null
|
||||
removal_reason: string | null
|
||||
slug: string
|
||||
successor_ride_id: string | null
|
||||
}
|
||||
Insert: {
|
||||
created_at?: string
|
||||
final_state_data: Json
|
||||
id?: string
|
||||
name: string
|
||||
operated_from?: string | null
|
||||
operated_until?: string | null
|
||||
original_ride_id?: string | null
|
||||
park_id?: string | null
|
||||
relocated_to_park_id?: string | null
|
||||
removal_reason?: string | null
|
||||
slug: string
|
||||
successor_ride_id?: string | null
|
||||
}
|
||||
Update: {
|
||||
created_at?: string
|
||||
final_state_data?: Json
|
||||
id?: string
|
||||
name?: string
|
||||
operated_from?: string | null
|
||||
operated_until?: string | null
|
||||
original_ride_id?: string | null
|
||||
park_id?: string | null
|
||||
relocated_to_park_id?: string | null
|
||||
removal_reason?: string | null
|
||||
slug?: string
|
||||
successor_ride_id?: string | null
|
||||
}
|
||||
Relationships: [
|
||||
{
|
||||
foreignKeyName: "historical_rides_original_ride_id_fkey"
|
||||
columns: ["original_ride_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "rides"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
{
|
||||
foreignKeyName: "historical_rides_park_id_fkey"
|
||||
columns: ["park_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "parks"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
{
|
||||
foreignKeyName: "historical_rides_relocated_to_park_id_fkey"
|
||||
columns: ["relocated_to_park_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "parks"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
{
|
||||
foreignKeyName: "historical_rides_successor_ride_id_fkey"
|
||||
columns: ["successor_ride_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "rides"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
]
|
||||
}
|
||||
locations: {
|
||||
Row: {
|
||||
city: string | null
|
||||
@@ -482,6 +755,58 @@ export type Database = {
|
||||
}
|
||||
Relationships: []
|
||||
}
|
||||
park_location_history: {
|
||||
Row: {
|
||||
created_at: string
|
||||
id: string
|
||||
moved_at: string
|
||||
new_location_id: string
|
||||
old_location_id: string | null
|
||||
park_id: string
|
||||
reason: string | null
|
||||
}
|
||||
Insert: {
|
||||
created_at?: string
|
||||
id?: string
|
||||
moved_at: string
|
||||
new_location_id: string
|
||||
old_location_id?: string | null
|
||||
park_id: string
|
||||
reason?: string | null
|
||||
}
|
||||
Update: {
|
||||
created_at?: string
|
||||
id?: string
|
||||
moved_at?: string
|
||||
new_location_id?: string
|
||||
old_location_id?: string | null
|
||||
park_id?: string
|
||||
reason?: string | null
|
||||
}
|
||||
Relationships: [
|
||||
{
|
||||
foreignKeyName: "park_location_history_new_location_id_fkey"
|
||||
columns: ["new_location_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "locations"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
{
|
||||
foreignKeyName: "park_location_history_old_location_id_fkey"
|
||||
columns: ["old_location_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "locations"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
{
|
||||
foreignKeyName: "park_location_history_park_id_fkey"
|
||||
columns: ["park_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "parks"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
]
|
||||
}
|
||||
park_operating_hours: {
|
||||
Row: {
|
||||
closing_time: string | null
|
||||
@@ -2168,6 +2493,45 @@ export type Database = {
|
||||
}
|
||||
Relationships: []
|
||||
}
|
||||
version_diffs: {
|
||||
Row: {
|
||||
created_at: string
|
||||
diff_data: Json
|
||||
from_version_id: string
|
||||
id: string
|
||||
to_version_id: string
|
||||
}
|
||||
Insert: {
|
||||
created_at?: string
|
||||
diff_data: Json
|
||||
from_version_id: string
|
||||
id?: string
|
||||
to_version_id: string
|
||||
}
|
||||
Update: {
|
||||
created_at?: string
|
||||
diff_data?: Json
|
||||
from_version_id?: string
|
||||
id?: string
|
||||
to_version_id?: string
|
||||
}
|
||||
Relationships: [
|
||||
{
|
||||
foreignKeyName: "version_diffs_from_version_id_fkey"
|
||||
columns: ["from_version_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "entity_versions"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
{
|
||||
foreignKeyName: "version_diffs_to_version_id_fkey"
|
||||
columns: ["to_version_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "entity_versions"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
Views: {
|
||||
moderation_sla_metrics: {
|
||||
@@ -2230,6 +2594,26 @@ export type Database = {
|
||||
Args: Record<PropertyKey, never>
|
||||
Returns: undefined
|
||||
}
|
||||
compare_versions: {
|
||||
Args: { p_from_version_id: string; p_to_version_id: string }
|
||||
Returns: Json
|
||||
}
|
||||
create_entity_version: {
|
||||
Args: {
|
||||
p_change_reason?: string
|
||||
p_change_type?: Database["public"]["Enums"]["version_change_type"]
|
||||
p_changed_by: string
|
||||
p_entity_id: string
|
||||
p_entity_type: string
|
||||
p_submission_id?: string
|
||||
p_version_data: Json
|
||||
}
|
||||
Returns: string
|
||||
}
|
||||
create_field_history_entries: {
|
||||
Args: { p_new_data: Json; p_old_data: Json; p_version_id: string }
|
||||
Returns: undefined
|
||||
}
|
||||
extend_submission_lock: {
|
||||
Args: {
|
||||
extension_duration?: unknown
|
||||
@@ -2306,6 +2690,16 @@ export type Database = {
|
||||
Args: { moderator_id: string; submission_id: string }
|
||||
Returns: boolean
|
||||
}
|
||||
rollback_to_version: {
|
||||
Args: {
|
||||
p_changed_by: string
|
||||
p_entity_id: string
|
||||
p_entity_type: string
|
||||
p_reason: string
|
||||
p_target_version_id: string
|
||||
}
|
||||
Returns: string
|
||||
}
|
||||
update_company_ratings: {
|
||||
Args: { target_company_id: string }
|
||||
Returns: undefined
|
||||
@@ -2325,6 +2719,12 @@ export type Database = {
|
||||
}
|
||||
Enums: {
|
||||
app_role: "admin" | "moderator" | "user" | "superuser"
|
||||
version_change_type:
|
||||
| "created"
|
||||
| "updated"
|
||||
| "deleted"
|
||||
| "restored"
|
||||
| "archived"
|
||||
}
|
||||
CompositeTypes: {
|
||||
[_ in never]: never
|
||||
@@ -2453,6 +2853,13 @@ export const Constants = {
|
||||
public: {
|
||||
Enums: {
|
||||
app_role: ["admin", "moderator", "user", "superuser"],
|
||||
version_change_type: [
|
||||
"created",
|
||||
"updated",
|
||||
"deleted",
|
||||
"restored",
|
||||
"archived",
|
||||
],
|
||||
},
|
||||
},
|
||||
} as const
|
||||
|
||||
Reference in New Issue
Block a user