{
  "version": "5",
  "dialect": "mysql",
  "id": "6b3bf848-2736-4d90-aaa4-fa8600100a50",
  "prevId": "2c808e62-3e92-4e5c-b733-d4e45e2fb2c1",
  "tables": {
    "adminNotifications": {
      "name": "adminNotifications",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "userId": {
          "name": "userId",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "type": {
          "name": "type",
          "type": "enum('nouvelle_demande','demande_en_retard','dossier_incomplet','nouvelle_association','systeme','changement_salle','annulation_demande','modification_demande')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "titre": {
          "name": "titre",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "message": {
          "name": "message",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "lien": {
          "name": "lien",
          "type": "varchar(512)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "lu": {
          "name": "lu",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": false
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "adminNotifications_id": {
          "name": "adminNotifications_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "associations": {
      "name": "associations",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "userId": {
          "name": "userId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "nomAssociation": {
          "name": "nomAssociation",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "siret": {
          "name": "siret",
          "type": "varchar(14)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "rna": {
          "name": "rna",
          "type": "varchar(10)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "adresse": {
          "name": "adresse",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "codePostal": {
          "name": "codePostal",
          "type": "varchar(10)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "ville": {
          "name": "ville",
          "type": "varchar(100)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "telephone": {
          "name": "telephone",
          "type": "varchar(20)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "emailContact": {
          "name": "emailContact",
          "type": "varchar(320)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "siteWeb": {
          "name": "siteWeb",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "dateCreation": {
          "name": "dateCreation",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "objetAssociation": {
          "name": "objetAssociation",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "statutJuridique": {
          "name": "statutJuridique",
          "type": "enum('association_loi_1901','association_reconnue_utilite_publique','fondation','autre')",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": "'association_loi_1901'"
        },
        "nomRepresentant": {
          "name": "nomRepresentant",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "fonctionRepresentant": {
          "name": "fonctionRepresentant",
          "type": "varchar(100)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "profileComplete": {
          "name": "profileComplete",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": false
        },
        "isActive": {
          "name": "isActive",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": true
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updatedAt": {
          "name": "updatedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "associations_id": {
          "name": "associations_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "associations_userId_unique": {
          "name": "associations_userId_unique",
          "columns": [
            "userId"
          ]
        }
      },
      "checkConstraint": {}
    },
    "auditLog": {
      "name": "auditLog",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "userId": {
          "name": "userId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "action": {
          "name": "action",
          "type": "varchar(100)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "entityType": {
          "name": "entityType",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "entityId": {
          "name": "entityId",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "details": {
          "name": "details",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "ipAddress": {
          "name": "ipAddress",
          "type": "varchar(45)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "auditLog_id": {
          "name": "auditLog_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "documents": {
      "name": "documents",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "associationId": {
          "name": "associationId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "nom": {
          "name": "nom",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "type": {
          "name": "type",
          "type": "enum('statuts','recepisse_declaration','rib','rapport_activite','rapport_financier','pv_assemblee','liste_dirigeants','attestation_assurance','autre')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "fileKey": {
          "name": "fileKey",
          "type": "varchar(512)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "fileUrl": {
          "name": "fileUrl",
          "type": "varchar(1024)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "mimeType": {
          "name": "mimeType",
          "type": "varchar(100)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "fileSize": {
          "name": "fileSize",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "uploadedAt": {
          "name": "uploadedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updatedAt": {
          "name": "updatedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "documents_id": {
          "name": "documents_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "emailActionTokens": {
      "name": "emailActionTokens",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "token": {
          "name": "token",
          "type": "varchar(64)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "requestId": {
          "name": "requestId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "action": {
          "name": "action",
          "type": "enum('validee','refusee')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "used": {
          "name": "used",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "expiresAt": {
          "name": "expiresAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "usedAt": {
          "name": "usedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "usedBy": {
          "name": "usedBy",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "emailActionTokens_id": {
          "name": "emailActionTokens_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "emailActionTokens_token_unique": {
          "name": "emailActionTokens_token_unique",
          "columns": [
            "token"
          ]
        }
      },
      "checkConstraint": {}
    },
    "portalSettings": {
      "name": "portalSettings",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "cle": {
          "name": "cle",
          "type": "varchar(100)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "valeur": {
          "name": "valeur",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "updatedAt": {
          "name": "updatedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "portalSettings_id": {
          "name": "portalSettings_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "portalSettings_cle_unique": {
          "name": "portalSettings_cle_unique",
          "columns": [
            "cle"
          ]
        }
      },
      "checkConstraint": {}
    },
    "requestHistory": {
      "name": "requestHistory",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "requestId": {
          "name": "requestId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "action": {
          "name": "action",
          "type": "enum('creation','soumission','assignation','changement_statut','ajout_commentaire','modification','validation','refus','changement_salle','annulation')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "ancienStatut": {
          "name": "ancienStatut",
          "type": "enum('brouillon','soumise','en_cours_traitement','information_complementaire','validee','refusee','annulee')",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "nouveauStatut": {
          "name": "nouveauStatut",
          "type": "enum('brouillon','soumise','en_cours_traitement','information_complementaire','validee','refusee','annulee')",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "commentaire": {
          "name": "commentaire",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "userId": {
          "name": "userId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "requestHistory_id": {
          "name": "requestHistory_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "requestTemplates": {
      "name": "requestTemplates",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "type": {
          "name": "type",
          "type": "enum('subvention_fonctionnement','subvention_projet','agrement_jeunesse_education','agrement_sport','autorisation_occupation','demande_salle','autre')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "nom": {
          "name": "nom",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "formSchema": {
          "name": "formSchema",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "documentsRequis": {
          "name": "documentsRequis",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "serviceDestinataire": {
          "name": "serviceDestinataire",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "emailDestinataire": {
          "name": "emailDestinataire",
          "type": "varchar(320)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "delaiTraitementJours": {
          "name": "delaiTraitementJours",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 30
        },
        "actif": {
          "name": "actif",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": true
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updatedAt": {
          "name": "updatedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "requestTemplates_id": {
          "name": "requestTemplates_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "requests": {
      "name": "requests",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "associationId": {
          "name": "associationId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "type": {
          "name": "type",
          "type": "enum('subvention_fonctionnement','subvention_projet','agrement_jeunesse_education','agrement_sport','autorisation_occupation','demande_salle','autre')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "titre": {
          "name": "titre",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "formData": {
          "name": "formData",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "enum('brouillon','soumise','en_cours_traitement','information_complementaire','validee','refusee','annulee')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'brouillon'"
        },
        "priority": {
          "name": "priority",
          "type": "enum('basse','normale','haute','urgente')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'normale'"
        },
        "montantDemande": {
          "name": "montantDemande",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "montantAccorde": {
          "name": "montantAccorde",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "dateSubmission": {
          "name": "dateSubmission",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "dateTraitement": {
          "name": "dateTraitement",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "dateLimiteTraitement": {
          "name": "dateLimiteTraitement",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "assigneA": {
          "name": "assigneA",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "traitePar": {
          "name": "traitePar",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "commentaireAdmin": {
          "name": "commentaireAdmin",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "documentsJoints": {
          "name": "documentsJoints",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updatedAt": {
          "name": "updatedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "requests_id": {
          "name": "requests_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "responseTemplates": {
      "name": "responseTemplates",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "nom": {
          "name": "nom",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "type": {
          "name": "type",
          "type": "enum('validation','refus','information_complementaire','autre')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "sujet": {
          "name": "sujet",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "contenu": {
          "name": "contenu",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "actif": {
          "name": "actif",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": true
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updatedAt": {
          "name": "updatedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "responseTemplates_id": {
          "name": "responseTemplates_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "users": {
      "name": "users",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "openId": {
          "name": "openId",
          "type": "varchar(64)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "email": {
          "name": "email",
          "type": "varchar(320)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "loginMethod": {
          "name": "loginMethod",
          "type": "varchar(64)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "role": {
          "name": "role",
          "type": "enum('user','admin','super_admin')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'user'"
        },
        "isActive": {
          "name": "isActive",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": true
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updatedAt": {
          "name": "updatedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        },
        "lastSignedIn": {
          "name": "lastSignedIn",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "users_id": {
          "name": "users_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "users_openId_unique": {
          "name": "users_openId_unique",
          "columns": [
            "openId"
          ]
        }
      },
      "checkConstraint": {}
    }
  },
  "views": {},
  "_meta": {
    "schemas": {},
    "tables": {},
    "columns": {}
  },
  "internal": {
    "tables": {},
    "indexes": {}
  }
}