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: {
Row: {
building_address: string | null
building_location: string | null
created_at: string | null
description: string | null
id: string
@@ -73,7 +73,7 @@ export type Database = {
updated_at: string | null
}
Insert: {
building_address?: string | null
building_location?: string | null
created_at?: string | null
description?: string | null
id?: string
@@ -81,7 +81,7 @@ export type Database = {
updated_at?: string | null
}
Update: {
building_address?: string | null
building_location?: string | null
created_at?: string | null
description?: string | null
id?: string

View File

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

View File

@@ -32,7 +32,7 @@
<hr />
<div class="whereSubtitle">Where it is:</div>
<p class="addrContainer">
{space.building_address}
{space.building_location}
</p>
</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,
-- Location within building, e.g., "Room 101"
location text,
building_address text,
building_location text,
created_at timestamp with time zone DEFAULT now(),
updated_at timestamp with time zone DEFAULT now()
);