chore: rename address to building location

This commit is contained in:
2025-06-04 23:35:02 +01:00
parent c1de092525
commit b49f937dcb
5 changed files with 12 additions and 11 deletions

View File

@@ -65,7 +65,7 @@ export type Database = {
} }
study_spaces: { study_spaces: {
Row: { Row: {
building_address: string | null building_location: string | null
created_at: string | null created_at: string | null
description: string | null description: string | null
id: string id: string
@@ -73,7 +73,7 @@ export type Database = {
updated_at: string | null updated_at: string | null
} }
Insert: { Insert: {
building_address?: string | null building_location?: string | null
created_at?: string | null created_at?: string | null
description?: string | null description?: string | null
id?: string id?: string
@@ -81,7 +81,7 @@ export type Database = {
updated_at?: string | null updated_at?: string | null
} }
Update: { Update: {
building_address?: string | null building_location?: string | null
created_at?: string | null created_at?: string | null
description?: string | null description?: string | null
id?: string id?: string

View File

@@ -14,7 +14,7 @@
let spaceImg = $state<FileList>(); let spaceImg = $state<FileList>();
let studySpaceData = $state<Omit<Table<"study_spaces">, "id" | "created_at" | "updated_at">>({ let studySpaceData = $state<Omit<Table<"study_spaces">, "id" | "created_at" | "updated_at">>({
description: "", description: "",
building_address: "", building_location: "",
location: "" location: ""
}); });
@@ -81,16 +81,16 @@
<Textarea <Textarea
name="description" name="description"
bind:value={studySpaceData.description} bind:value={studySpaceData.description}
placeholder="A quiet, but small study space..." placeholder="A quiet and well-lit, but small space..."
rows={5} rows={5}
required required
/> />
<label for="address">Add an address:</label> <label for="building-location">Add the building location:</label>
<Text <Text
name="address" name="building-location"
bind:value={studySpaceData.building_address} bind:value={studySpaceData.building_location}
placeholder="180 Queen's Gate, London, SW7 5HF" placeholder="Huxley Building, Imperial South Kensington Campus"
required required
/> />

View File

@@ -32,7 +32,7 @@
<hr /> <hr />
<div class="whereSubtitle">Where it is:</div> <div class="whereSubtitle">Where it is:</div>
<p class="addrContainer"> <p class="addrContainer">
{space.building_address} {space.building_location}
</p> </p>
</main> </main>

View File

@@ -0,0 +1 @@
ALTER TABLE study_spaces RENAME COLUMN "building_address" TO "building_location";

View File

@@ -11,7 +11,7 @@ CREATE TABLE study_spaces (
description text, description text,
-- Location within building, e.g., "Room 101" -- Location within building, e.g., "Room 101"
location text, location text,
building_address text, building_location text,
created_at timestamp with time zone DEFAULT now(), created_at timestamp with time zone DEFAULT now(),
updated_at timestamp with time zone DEFAULT now() updated_at timestamp with time zone DEFAULT now()
); );