mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 06:11:11 -05:00
Remove old versioning system
This commit is contained in:
@@ -543,44 +543,6 @@ export type Database = {
|
|||||||
}
|
}
|
||||||
Relationships: []
|
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_page_views: {
|
entity_page_views: {
|
||||||
Row: {
|
Row: {
|
||||||
created_at: string | null
|
created_at: string | null
|
||||||
@@ -608,103 +570,6 @@ export type Database = {
|
|||||||
}
|
}
|
||||||
Relationships: []
|
Relationships: []
|
||||||
}
|
}
|
||||||
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"]
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
entity_versions_archive: {
|
entity_versions_archive: {
|
||||||
Row: {
|
Row: {
|
||||||
change_reason: string | null
|
change_reason: string | null
|
||||||
@@ -3301,45 +3166,6 @@ export type Database = {
|
|||||||
}
|
}
|
||||||
Relationships: []
|
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: {
|
Views: {
|
||||||
filtered_profiles: {
|
filtered_profiles: {
|
||||||
@@ -3505,26 +3331,6 @@ export type Database = {
|
|||||||
Args: Record<PropertyKey, never>
|
Args: Record<PropertyKey, never>
|
||||||
Returns: undefined
|
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: {
|
extend_submission_lock: {
|
||||||
Args: {
|
Args: {
|
||||||
extension_duration?: unknown
|
extension_duration?: unknown
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
-- Drop old JSONB versioning system completely
|
||||||
|
-- This removes all deprecated tables and functions
|
||||||
|
|
||||||
|
-- Drop dependent tables first
|
||||||
|
DROP TABLE IF EXISTS public.version_diffs CASCADE;
|
||||||
|
DROP TABLE IF EXISTS public.entity_relationships_history CASCADE;
|
||||||
|
DROP TABLE IF EXISTS public.entity_field_history CASCADE;
|
||||||
|
|
||||||
|
-- Drop main legacy table (archive remains)
|
||||||
|
DROP TABLE IF EXISTS public.entity_versions CASCADE;
|
||||||
|
|
||||||
|
-- Drop old RPC functions
|
||||||
|
DROP FUNCTION IF EXISTS public.create_entity_version(
|
||||||
|
text, uuid, jsonb, uuid, text, uuid, version_change_type
|
||||||
|
) CASCADE;
|
||||||
|
|
||||||
|
DROP FUNCTION IF EXISTS public.compare_versions(uuid, uuid) CASCADE;
|
||||||
|
|
||||||
|
DROP FUNCTION IF EXISTS public.create_field_history_entries(uuid, jsonb, jsonb) CASCADE;
|
||||||
|
|
||||||
|
-- Note: We keep rollback_to_version as it's been updated for relational system
|
||||||
Reference in New Issue
Block a user