Go to Scriptcase store

# Association tables

The Associate Tables screen will be displayed if the Use existing tables option is selected in the Configure Connection step.

> When using the Create tables option, this step will be carried out automatically, with the tables that will be created by the security module generator.

At this stage, fields from existing tables must be associated with security application fields (applications generated by the Security Module).

Check below the structure of the tables created for this type of security.

##### sec_users

    CREATE TABLE "sec_users" (
        "login" TEXT NOT NULL,
        "pswd" TEXT NOT NULL,
        "name" TEXT,
        "email" TEXT,
        "active" TEXT,
        "activation_code" TEXT,
        "priv_admin" TEXT,
        "mfa" TEXT,
        "picture" BLOB,
        "role" TEXT,
        "phone" TEXT,
        "pswd_last_updated" TIMESTAMP,
        "mfa_last_updated" TIMESTAMP DEFAULT NULL,
        PRIMARY KEY ("login")
    );

##### sec_logged

    CREATE TABLE "sec_logged" (
        login TEXT NOT NULL,
        date_login TEXT,
        sc_session TEXT,
        ip TEXT
    );

> NOTA: A tabela Usuários logados será criada somente se a opção Proteger usuários logados for habilitada durante a criação do Módulo de Segurança.

##### sec_users_social

    CREATE TABLE "sec_users_social" (
      "login" TEXT NOT NULL,
      "resource" TEXT NOT NULL,
      "resource_id" TEXT NOT NULL,
      PRIMARY KEY ("login", "resource", "resource_id")
    );

> NOTA: A tabela users_social será criada somente se a opção Utilizar redes sociais for verificada durante a criação do Módulo de Segurança.