-- Tanzania Regions and Districts Database
-- Run this to add regions and districts tables


-- Create regions table
CREATE TABLE IF NOT EXISTS regions (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    code VARCHAR(10) NULL
);

-- Create districts table
CREATE TABLE IF NOT EXISTS districts (
    id INT AUTO_INCREMENT PRIMARY KEY,
    region_id INT NOT NULL,
    name VARCHAR(100) NOT NULL,
    FOREIGN KEY (region_id) REFERENCES regions(id) ON DELETE CASCADE
);

-- Create villages table (user can add villages)
CREATE TABLE IF NOT EXISTS villages (
    id INT AUTO_INCREMENT PRIMARY KEY,
    district_id INT NOT NULL,
    name VARCHAR(100) NOT NULL,
    added_by INT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (district_id) REFERENCES districts(id) ON DELETE CASCADE,
    FOREIGN KEY (added_by) REFERENCES users(id) ON DELETE SET NULL
);

-- Insert Tanzania Regions
INSERT INTO regions (name) VALUES
('Arusha'),
('Dar es Salaam'),
('Dodoma'),
('Geita'),
('Iringa'),
('Kagera'),
('Katavi'),
('Kigoma'),
('Kilimanjaro'),
('Lindi'),
('Manyara'),
('Mara'),
('Mbeya'),
('Morogoro'),
('Mtwara'),
('Mwanza'),
('Njombe'),
('Pemba North'),
('Pemba South'),
('Pwani'),
('Rukwa'),
('Ruvuma'),
('Shinyanga'),
('Simiyu'),
('Singida'),
('Songwe'),
('Tabora'),
('Tanga'),
('Zanzibar North'),
('Zanzibar South'),
('Zanzibar West');

-- Insert Districts by Region

-- Arusha Districts
INSERT INTO districts (region_id, name) SELECT id, 'Arusha City' FROM regions WHERE name = 'Arusha';
INSERT INTO districts (region_id, name) SELECT id, 'Arusha District' FROM regions WHERE name = 'Arusha';
INSERT INTO districts (region_id, name) SELECT id, 'Karatu' FROM regions WHERE name = 'Arusha';
INSERT INTO districts (region_id, name) SELECT id, 'Longido' FROM regions WHERE name = 'Arusha';
INSERT INTO districts (region_id, name) SELECT id, 'Meru' FROM regions WHERE name = 'Arusha';
INSERT INTO districts (region_id, name) SELECT id, 'Monduli' FROM regions WHERE name = 'Arusha';
INSERT INTO districts (region_id, name) SELECT id, 'Ngorongoro' FROM regions WHERE name = 'Arusha';

-- Dar es Salaam Districts
INSERT INTO districts (region_id, name) SELECT id, 'Ilala' FROM regions WHERE name = 'Dar es Salaam';
INSERT INTO districts (region_id, name) SELECT id, 'Kigamboni' FROM regions WHERE name = 'Dar es Salaam';
INSERT INTO districts (region_id, name) SELECT id, 'Kinondoni' FROM regions WHERE name = 'Dar es Salaam';
INSERT INTO districts (region_id, name) SELECT id, 'Temeke' FROM regions WHERE name = 'Dar es Salaam';
INSERT INTO districts (region_id, name) SELECT id, 'Ubungo' FROM regions WHERE name = 'Dar es Salaam';

-- Dodoma Districts
INSERT INTO districts (region_id, name) SELECT id, 'Bahi' FROM regions WHERE name = 'Dodoma';
INSERT INTO districts (region_id, name) SELECT id, 'Chamwino' FROM regions WHERE name = 'Dodoma';
INSERT INTO districts (region_id, name) SELECT id, 'Chemba' FROM regions WHERE name = 'Dodoma';
INSERT INTO districts (region_id, name) SELECT id, 'Dodoma City' FROM regions WHERE name = 'Dodoma';
INSERT INTO districts (region_id, name) SELECT id, 'Kondoa' FROM regions WHERE name = 'Dodoma';
INSERT INTO districts (region_id, name) SELECT id, 'Kongwa' FROM regions WHERE name = 'Dodoma';
INSERT INTO districts (region_id, name) SELECT id, 'Mpwapwa' FROM regions WHERE name = 'Dodoma';

-- Geita Districts
INSERT INTO districts (region_id, name) SELECT id, 'Bukombe' FROM regions WHERE name = 'Geita';
INSERT INTO districts (region_id, name) SELECT id, 'Chato' FROM regions WHERE name = 'Geita';
INSERT INTO districts (region_id, name) SELECT id, 'Geita Town' FROM regions WHERE name = 'Geita';
INSERT INTO districts (region_id, name) SELECT id, 'Mbogwe' FROM regions WHERE name = 'Geita';
INSERT INTO districts (region_id, name) SELECT id, 'Nyang\'hwale' FROM regions WHERE name = 'Geita';

-- Iringa Districts
INSERT INTO districts (region_id, name) SELECT id, 'Iringa District' FROM regions WHERE name = 'Iringa';
INSERT INTO districts (region_id, name) SELECT id, 'Iringa Municipal' FROM regions WHERE name = 'Iringa';
INSERT INTO districts (region_id, name) SELECT id, 'Kilolo' FROM regions WHERE name = 'Iringa';
INSERT INTO districts (region_id, name) SELECT id, 'Mafinga Town' FROM regions WHERE name = 'Iringa';
INSERT INTO districts (region_id, name) SELECT id, 'Mufindi' FROM regions WHERE name = 'Iringa';

-- Kagera Districts
INSERT INTO districts (region_id, name) SELECT id, 'Biharamulo' FROM regions WHERE name = 'Kagera';
INSERT INTO districts (region_id, name) SELECT id, 'Bukoba District' FROM regions WHERE name = 'Kagera';
INSERT INTO districts (region_id, name) SELECT id, 'Bukoba Municipal' FROM regions WHERE name = 'Kagera';
INSERT INTO districts (region_id, name) SELECT id, 'Karagwe' FROM regions WHERE name = 'Kagera';
INSERT INTO districts (region_id, name) SELECT id, 'Kyerwa' FROM regions WHERE name = 'Kagera';
INSERT INTO districts (region_id, name) SELECT id, 'Missenyi' FROM regions WHERE name = 'Kagera';
INSERT INTO districts (region_id, name) SELECT id, 'Muleba' FROM regions WHERE name = 'Kagera';
INSERT INTO districts (region_id, name) SELECT id, 'Ngara' FROM regions WHERE name = 'Kagera';

-- Katavi Districts
INSERT INTO districts (region_id, name) SELECT id, 'Mlele' FROM regions WHERE name = 'Katavi';
INSERT INTO districts (region_id, name) SELECT id, 'Mpanda Town' FROM regions WHERE name = 'Katavi';
INSERT INTO districts (region_id, name) SELECT id, 'Mpanda District' FROM regions WHERE name = 'Katavi';

-- Kigoma Districts
INSERT INTO districts (region_id, name) SELECT id, 'Buhigwe' FROM regions WHERE name = 'Kigoma';
INSERT INTO districts (region_id, name) SELECT id, 'Kakonko' FROM regions WHERE name = 'Kigoma';
INSERT INTO districts (region_id, name) SELECT id, 'Kasulu District' FROM regions WHERE name = 'Kigoma';
INSERT INTO districts (region_id, name) SELECT id, 'Kasulu Town' FROM regions WHERE name = 'Kigoma';
INSERT INTO districts (region_id, name) SELECT id, 'Kibondo' FROM regions WHERE name = 'Kigoma';
INSERT INTO districts (region_id, name) SELECT id, 'Kigoma District' FROM regions WHERE name = 'Kigoma';
INSERT INTO districts (region_id, name) SELECT id, 'Kigoma-Ujiji Municipal' FROM regions WHERE name = 'Kigoma';
INSERT INTO districts (region_id, name) SELECT id, 'Uvinza' FROM regions WHERE name = 'Kigoma';

-- Kilimanjaro Districts
INSERT INTO districts (region_id, name) SELECT id, 'Hai' FROM regions WHERE name = 'Kilimanjaro';
INSERT INTO districts (region_id, name) SELECT id, 'Moshi District' FROM regions WHERE name = 'Kilimanjaro';
INSERT INTO districts (region_id, name) SELECT id, 'Moshi Municipal' FROM regions WHERE name = 'Kilimanjaro';
INSERT INTO districts (region_id, name) SELECT id, 'Mwanga' FROM regions WHERE name = 'Kilimanjaro';
INSERT INTO districts (region_id, name) SELECT id, 'Rombo' FROM regions WHERE name = 'Kilimanjaro';
INSERT INTO districts (region_id, name) SELECT id, 'Same' FROM regions WHERE name = 'Kilimanjaro';
INSERT INTO districts (region_id, name) SELECT id, 'Siha' FROM regions WHERE name = 'Kilimanjaro';

-- Lindi Districts
INSERT INTO districts (region_id, name) SELECT id, 'Kilwa' FROM regions WHERE name = 'Lindi';
INSERT INTO districts (region_id, name) SELECT id, 'Lindi District' FROM regions WHERE name = 'Lindi';
INSERT INTO districts (region_id, name) SELECT id, 'Lindi Municipal' FROM regions WHERE name = 'Lindi';
INSERT INTO districts (region_id, name) SELECT id, 'Liwale' FROM regions WHERE name = 'Lindi';
INSERT INTO districts (region_id, name) SELECT id, 'Nachingwea' FROM regions WHERE name = 'Lindi';
INSERT INTO districts (region_id, name) SELECT id, 'Ruangwa' FROM regions WHERE name = 'Lindi';

-- Manyara Districts
INSERT INTO districts (region_id, name) SELECT id, 'Babati Town' FROM regions WHERE name = 'Manyara';
INSERT INTO districts (region_id, name) SELECT id, 'Babati District' FROM regions WHERE name = 'Manyara';
INSERT INTO districts (region_id, name) SELECT id, 'Hanang' FROM regions WHERE name = 'Manyara';
INSERT INTO districts (region_id, name) SELECT id, 'Kiteto' FROM regions WHERE name = 'Manyara';
INSERT INTO districts (region_id, name) SELECT id, 'Mbulu' FROM regions WHERE name = 'Manyara';
INSERT INTO districts (region_id, name) SELECT id, 'Simanjiro' FROM regions WHERE name = 'Manyara';

-- Mara Districts
INSERT INTO districts (region_id, name) SELECT id, 'Bunda' FROM regions WHERE name = 'Mara';
INSERT INTO districts (region_id, name) SELECT id, 'Butiama' FROM regions WHERE name = 'Mara';
INSERT INTO districts (region_id, name) SELECT id, 'Musoma District' FROM regions WHERE name = 'Mara';
INSERT INTO districts (region_id, name) SELECT id, 'Musoma Municipal' FROM regions WHERE name = 'Mara';
INSERT INTO districts (region_id, name) SELECT id, 'Rorya' FROM regions WHERE name = 'Mara';
INSERT INTO districts (region_id, name) SELECT id, 'Serengeti' FROM regions WHERE name = 'Mara';
INSERT INTO districts (region_id, name) SELECT id, 'Tarime' FROM regions WHERE name = 'Mara';

-- Mbeya Districts
INSERT INTO districts (region_id, name) SELECT id, 'Busokelo' FROM regions WHERE name = 'Mbeya';
INSERT INTO districts (region_id, name) SELECT id, 'Chunya' FROM regions WHERE name = 'Mbeya';
INSERT INTO districts (region_id, name) SELECT id, 'Kyela' FROM regions WHERE name = 'Mbeya';
INSERT INTO districts (region_id, name) SELECT id, 'Mbarali' FROM regions WHERE name = 'Mbeya';
INSERT INTO districts (region_id, name) SELECT id, 'Mbeya City' FROM regions WHERE name = 'Mbeya';
INSERT INTO districts (region_id, name) SELECT id, 'Mbeya District' FROM regions WHERE name = 'Mbeya';
INSERT INTO districts (region_id, name) SELECT id, 'Rungwe' FROM regions WHERE name = 'Mbeya';

-- Morogoro Districts
INSERT INTO districts (region_id, name) SELECT id, 'Gairo' FROM regions WHERE name = 'Morogoro';
INSERT INTO districts (region_id, name) SELECT id, 'Kilombero' FROM regions WHERE name = 'Morogoro';
INSERT INTO districts (region_id, name) SELECT id, 'Kilosa' FROM regions WHERE name = 'Morogoro';
INSERT INTO districts (region_id, name) SELECT id, 'Morogoro District' FROM regions WHERE name = 'Morogoro';
INSERT INTO districts (region_id, name) SELECT id, 'Morogoro Municipal' FROM regions WHERE name = 'Morogoro';
INSERT INTO districts (region_id, name) SELECT id, 'Mvomero' FROM regions WHERE name = 'Morogoro';
INSERT INTO districts (region_id, name) SELECT id, 'Ulanga' FROM regions WHERE name = 'Morogoro';
INSERT INTO districts (region_id, name) SELECT id, 'Malinyi' FROM regions WHERE name = 'Morogoro';
INSERT INTO districts (region_id, name) SELECT id, 'Ifakara Town' FROM regions WHERE name = 'Morogoro';

-- Mtwara Districts
INSERT INTO districts (region_id, name) SELECT id, 'Masasi District' FROM regions WHERE name = 'Mtwara';
INSERT INTO districts (region_id, name) SELECT id, 'Masasi Town' FROM regions WHERE name = 'Mtwara';
INSERT INTO districts (region_id, name) SELECT id, 'Mtwara District' FROM regions WHERE name = 'Mtwara';
INSERT INTO districts (region_id, name) SELECT id, 'Mtwara Municipal' FROM regions WHERE name = 'Mtwara';
INSERT INTO districts (region_id, name) SELECT id, 'Nanyumbu' FROM regions WHERE name = 'Mtwara';
INSERT INTO districts (region_id, name) SELECT id, 'Newala' FROM regions WHERE name = 'Mtwara';
INSERT INTO districts (region_id, name) SELECT id, 'Tandahimba' FROM regions WHERE name = 'Mtwara';

-- Mwanza Districts
INSERT INTO districts (region_id, name) SELECT id, 'Ilemela' FROM regions WHERE name = 'Mwanza';
INSERT INTO districts (region_id, name) SELECT id, 'Kwimba' FROM regions WHERE name = 'Mwanza';
INSERT INTO districts (region_id, name) SELECT id, 'Magu' FROM regions WHERE name = 'Mwanza';
INSERT INTO districts (region_id, name) SELECT id, 'Misungwi' FROM regions WHERE name = 'Mwanza';
INSERT INTO districts (region_id, name) SELECT id, 'Nyamagana' FROM regions WHERE name = 'Mwanza';
INSERT INTO districts (region_id, name) SELECT id, 'Sengerema' FROM regions WHERE name = 'Mwanza';
INSERT INTO districts (region_id, name) SELECT id, 'Ukerewe' FROM regions WHERE name = 'Mwanza';
INSERT INTO districts (region_id, name) SELECT id, 'Buchosa' FROM regions WHERE name = 'Mwanza';

-- Njombe Districts
INSERT INTO districts (region_id, name) SELECT id, 'Ludewa' FROM regions WHERE name = 'Njombe';
INSERT INTO districts (region_id, name) SELECT id, 'Makambako Town' FROM regions WHERE name = 'Njombe';
INSERT INTO districts (region_id, name) SELECT id, 'Makete' FROM regions WHERE name = 'Njombe';
INSERT INTO districts (region_id, name) SELECT id, 'Njombe District' FROM regions WHERE name = 'Njombe';
INSERT INTO districts (region_id, name) SELECT id, 'Njombe Town' FROM regions WHERE name = 'Njombe';
INSERT INTO districts (region_id, name) SELECT id, 'Wanging\'ombe' FROM regions WHERE name = 'Njombe';

-- Pemba North Districts
INSERT INTO districts (region_id, name) SELECT id, 'Micheweni' FROM regions WHERE name = 'Pemba North';
INSERT INTO districts (region_id, name) SELECT id, 'Wete' FROM regions WHERE name = 'Pemba North';

-- Pemba South Districts
INSERT INTO districts (region_id, name) SELECT id, 'Chake Chake' FROM regions WHERE name = 'Pemba South';
INSERT INTO districts (region_id, name) SELECT id, 'Mkoani' FROM regions WHERE name = 'Pemba South';

-- Pwani Districts
INSERT INTO districts (region_id, name) SELECT id, 'Bagamoyo' FROM regions WHERE name = 'Pwani';
INSERT INTO districts (region_id, name) SELECT id, 'Kibaha District' FROM regions WHERE name = 'Pwani';
INSERT INTO districts (region_id, name) SELECT id, 'Kibaha Town' FROM regions WHERE name = 'Pwani';
INSERT INTO districts (region_id, name) SELECT id, 'Kisarawe' FROM regions WHERE name = 'Pwani';
INSERT INTO districts (region_id, name) SELECT id, 'Mafia' FROM regions WHERE name = 'Pwani';
INSERT INTO districts (region_id, name) SELECT id, 'Mkuranga' FROM regions WHERE name = 'Pwani';
INSERT INTO districts (region_id, name) SELECT id, 'Rufiji' FROM regions WHERE name = 'Pwani';

-- Rukwa Districts
INSERT INTO districts (region_id, name) SELECT id, 'Kalambo' FROM regions WHERE name = 'Rukwa';
INSERT INTO districts (region_id, name) SELECT id, 'Nkasi' FROM regions WHERE name = 'Rukwa';
INSERT INTO districts (region_id, name) SELECT id, 'Sumbawanga District' FROM regions WHERE name = 'Rukwa';
INSERT INTO districts (region_id, name) SELECT id, 'Sumbawanga Municipal' FROM regions WHERE name = 'Rukwa';

-- Ruvuma Districts
INSERT INTO districts (region_id, name) SELECT id, 'Mbinga' FROM regions WHERE name = 'Ruvuma';
INSERT INTO districts (region_id, name) SELECT id, 'Namtumbo' FROM regions WHERE name = 'Ruvuma';
INSERT INTO districts (region_id, name) SELECT id, 'Nyasa' FROM regions WHERE name = 'Ruvuma';
INSERT INTO districts (region_id, name) SELECT id, 'Songea District' FROM regions WHERE name = 'Ruvuma';
INSERT INTO districts (region_id, name) SELECT id, 'Songea Municipal' FROM regions WHERE name = 'Ruvuma';
INSERT INTO districts (region_id, name) SELECT id, 'Tunduru' FROM regions WHERE name = 'Ruvuma';

-- Shinyanga Districts
INSERT INTO districts (region_id, name) SELECT id, 'Kahama Town' FROM regions WHERE name = 'Shinyanga';
INSERT INTO districts (region_id, name) SELECT id, 'Kahama District' FROM regions WHERE name = 'Shinyanga';
INSERT INTO districts (region_id, name) SELECT id, 'Kishapu' FROM regions WHERE name = 'Shinyanga';
INSERT INTO districts (region_id, name) SELECT id, 'Shinyanga District' FROM regions WHERE name = 'Shinyanga';
INSERT INTO districts (region_id, name) SELECT id, 'Shinyanga Municipal' FROM regions WHERE name = 'Shinyanga';
INSERT INTO districts (region_id, name) SELECT id, 'Ushetu' FROM regions WHERE name = 'Shinyanga';

-- Simiyu Districts
INSERT INTO districts (region_id, name) SELECT id, 'Bariadi' FROM regions WHERE name = 'Simiyu';
INSERT INTO districts (region_id, name) SELECT id, 'Busega' FROM regions WHERE name = 'Simiyu';
INSERT INTO districts (region_id, name) SELECT id, 'Itilima' FROM regions WHERE name = 'Simiyu';
INSERT INTO districts (region_id, name) SELECT id, 'Maswa' FROM regions WHERE name = 'Simiyu';
INSERT INTO districts (region_id, name) SELECT id, 'Meatu' FROM regions WHERE name = 'Simiyu';

-- Singida Districts
INSERT INTO districts (region_id, name) SELECT id, 'Ikungi' FROM regions WHERE name = 'Singida';
INSERT INTO districts (region_id, name) SELECT id, 'Iramba' FROM regions WHERE name = 'Singida';
INSERT INTO districts (region_id, name) SELECT id, 'Manyoni' FROM regions WHERE name = 'Singida';
INSERT INTO districts (region_id, name) SELECT id, 'Mkalama' FROM regions WHERE name = 'Singida';
INSERT INTO districts (region_id, name) SELECT id, 'Singida District' FROM regions WHERE name = 'Singida';
INSERT INTO districts (region_id, name) SELECT id, 'Singida Municipal' FROM regions WHERE name = 'Singida';

-- Songwe Districts
INSERT INTO districts (region_id, name) SELECT id, 'Ileje' FROM regions WHERE name = 'Songwe';
INSERT INTO districts (region_id, name) SELECT id, 'Mbozi' FROM regions WHERE name = 'Songwe';
INSERT INTO districts (region_id, name) SELECT id, 'Momba' FROM regions WHERE name = 'Songwe';
INSERT INTO districts (region_id, name) SELECT id, 'Songwe District' FROM regions WHERE name = 'Songwe';
INSERT INTO districts (region_id, name) SELECT id, 'Tunduma Town' FROM regions WHERE name = 'Songwe';

-- Tabora Districts
INSERT INTO districts (region_id, name) SELECT id, 'Igunga' FROM regions WHERE name = 'Tabora';
INSERT INTO districts (region_id, name) SELECT id, 'Kaliua' FROM regions WHERE name = 'Tabora';
INSERT INTO districts (region_id, name) SELECT id, 'Nzega' FROM regions WHERE name = 'Tabora';
INSERT INTO districts (region_id, name) SELECT id, 'Sikonge' FROM regions WHERE name = 'Tabora';
INSERT INTO districts (region_id, name) SELECT id, 'Tabora Municipal' FROM regions WHERE name = 'Tabora';
INSERT INTO districts (region_id, name) SELECT id, 'Urambo' FROM regions WHERE name = 'Tabora';
INSERT INTO districts (region_id, name) SELECT id, 'Uyui' FROM regions WHERE name = 'Tabora';

-- Tanga Districts
INSERT INTO districts (region_id, name) SELECT id, 'Handeni' FROM regions WHERE name = 'Tanga';
INSERT INTO districts (region_id, name) SELECT id, 'Kilindi' FROM regions WHERE name = 'Tanga';
INSERT INTO districts (region_id, name) SELECT id, 'Korogwe Town' FROM regions WHERE name = 'Tanga';
INSERT INTO districts (region_id, name) SELECT id, 'Korogwe District' FROM regions WHERE name = 'Tanga';
INSERT INTO districts (region_id, name) SELECT id, 'Lushoto' FROM regions WHERE name = 'Tanga';
INSERT INTO districts (region_id, name) SELECT id, 'Mkinga' FROM regions WHERE name = 'Tanga';
INSERT INTO districts (region_id, name) SELECT id, 'Muheza' FROM regions WHERE name = 'Tanga';
INSERT INTO districts (region_id, name) SELECT id, 'Pangani' FROM regions WHERE name = 'Tanga';
INSERT INTO districts (region_id, name) SELECT id, 'Tanga City' FROM regions WHERE name = 'Tanga';
INSERT INTO districts (region_id, name) SELECT id, 'Bumbuli' FROM regions WHERE name = 'Tanga';

-- Zanzibar North Districts
INSERT INTO districts (region_id, name) SELECT id, 'Kaskazini A' FROM regions WHERE name = 'Zanzibar North';
INSERT INTO districts (region_id, name) SELECT id, 'Kaskazini B' FROM regions WHERE name = 'Zanzibar North';

-- Zanzibar South Districts
INSERT INTO districts (region_id, name) SELECT id, 'Kati' FROM regions WHERE name = 'Zanzibar South';
INSERT INTO districts (region_id, name) SELECT id, 'Kusini' FROM regions WHERE name = 'Zanzibar South';

-- Zanzibar West Districts
INSERT INTO districts (region_id, name) SELECT id, 'Magharibi A' FROM regions WHERE name = 'Zanzibar West';
INSERT INTO districts (region_id, name) SELECT id, 'Magharibi B' FROM regions WHERE name = 'Zanzibar West';
INSERT INTO districts (region_id, name) SELECT id, 'Mjini' FROM regions WHERE name = 'Zanzibar West';

-- Add columns to lands table for location details
ALTER TABLE lands ADD COLUMN region_id INT NULL AFTER location_address;
ALTER TABLE lands ADD COLUMN district_id INT NULL AFTER region_id;
ALTER TABLE lands ADD COLUMN village VARCHAR(100) NULL AFTER district_id;

-- Add beacon_landmarks table for landmarks between beacon points
CREATE TABLE IF NOT EXISTS beacon_landmarks (
    id INT AUTO_INCREMENT PRIMARY KEY,
    land_id INT NOT NULL,
    from_point INT NOT NULL,
    to_point INT NOT NULL,
    landmark_description TEXT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (land_id) REFERENCES lands(id) ON DELETE CASCADE
);

-- Add beacon_number column to beacon_points table
ALTER TABLE beacon_points ADD COLUMN beacon_number VARCHAR(50) NULL AFTER point_label;
ALTER TABLE beacon_points ADD COLUMN additional_info TEXT NULL AFTER beacon_number;
