DROP TABLE beacon_config_assignment;
DROP TABLE beacon_instance;

CREATE TABLE beacon_instance (
    beacon_id varchar PRIMARY KEY NOT NULL,
    template_id int NOT NULL,
    peer_ip varchar NOT NULL,
    nickname varchar NOT NULL,

    cwd varchar NOT NULL,
    operating_system varchar NOT NULL,
    beacon_userent varchar NOT NULL,
    hostname varchar NOT NULL,

    config_id int,

    FOREIGN KEY (template_id) REFERENCES beacon_template,
    FOREIGN KEY (config_id) REFERENCES beacon_config
);
