<commit_before><commit_msg>adding migration for formBirds probably needs bunch of EN/BG fields<commit_after>'use strict';

var tableName = 'FormBirds';

module.exports = {
  up: function (queryInterface, Sequelize) {
    return queryInterface.createTable(tableName, {
      //id, longitude, latitude, startDateTime,endDateTime, monitoringCode? species, 
      // confidential?, countUnit, typeUnit, typeNesting, count, countMin, countMax,
      // sex, age, marking, speciesType, behaviour, deadIndividualCauses,
      // substrate, tree, treeHeight, treeLocation, nestHeight, nestLocation,

      // brooding, eggsCount, countNestling, countFledgling, countSuccessfullyLeftNest
      // nestProtected, ageFemale, ageMale, nestingSuccess, landuse300mRadius  
      id: {
        type: Sequelize.INTEGER,
        primaryKey: true,
        autoIncrement: true
      },
      latitude: {
        type: Sequelize.FLOAT
      },
      longitude: {
        type: Sequelize.FLOAT
      },
      observationDateTime: {
        type: Sequelize.DATE,
        allowNull: false
      },
      //MonitoringCode autogenerated??
      species: {
        type: Sequelize.TEXT,
        allowNull: false
      },
      confidential: {
        type: Sequelize.BOOLEAN,
        defaultValue: false
      },
      countUnit: { //?
        type: Sequelize.TEXT,
        allowNull: false
      },
      typeUnit: { //?
        type: Sequelize.TEXT,
        allowNull: false
      },
      typeNesting: { //?
        type: Sequelize.TEXT,
        allowNull: false
      },
      count: {
        type: Sequelize.INTEGER,
        allowNull: false
      },      
      countMin: {
        type: Sequelize.INTEGER,
        allowNull: false
      },
      countMax: {
        type: Sequelize.INTEGER,
        allowNull: false
      },
      sex: { //?
        type: Sequelize.TEXT,
        allowNull: false
      },
      age: { //?
        type: Sequelize.TEXT,
        allowNull: false
      },
      marking: { //?
        type: Sequelize.TEXT,
        allowNull: false
      },
      speciesType: { //?
        type: Sequelize.TEXT,
        allowNull: false
      },
      behaviour: {//?
        type: Sequelize.TEXT,
        allowNull: false
      },
      deadIndividualCauses: { //?
        type: Sequelize.TEXT,
        allowNull: false
      },
      substrate: {//?
        type: Sequelize.TEXT,
        allowNull: false
      },
      tree: {
        type: Sequelize.TEXT,
        allowNull: false
      },
      treeHeight: {
        type: Sequelize.FLOAT,
        allowNull: false
      },
      treeLocation: {//? Do you agree on this name and type
        type: Sequelize.TEXT,
        allowNull: false
      },
      nestHeight: {//?
        type: Sequelize.TEXT,
        allowNull: false
      },
      nestLocation: {//?
        type: Sequelize.TEXT,
        allowNull: false
      },
      brooding: {
        type: Sequelize.BOOLEAN,
        allowNull: false
      },
      eggsCount: { //I don't see the point of float type here. Probably something specific..
        type: Sequelize.FLOAT,
        allowNull: false
      },
      countNestling: {
        type: Sequelize.FLOAT,
        allowNull: false
      },
      countFledgling: {
        type: Sequelize.FLOAT,
        allowNull: false
      },
      countSuccessfullyLeftNest: {
        type: Sequelize.FLOAT,
        allowNull: false
      },
      nestProtected: {
        type: Sequelize.BOOLEAN,
        allowNull: false
      },
      ageFemale: {
        type: Sequelize.TEXT,
        allowNull: false
      },
      ageMale: {
        type: Sequelize.TEXT,
        allowNull: false
      },
      nestingSuccess: {
        type: Sequelize.TEXT,
        allowNull: false
      },
      landuse300mRadius: {
        type: Sequelize.TEXT,
        allowNull: false
      },

      //Common fields
      source: {
        type: Sequelize.TEXT,
        allowNull: false
      },
      endDateTime: {
        type: Sequelize.DATE,
        allowNull: false
      },
      startDateTime: {
        type: Sequelize.DATE,
        allowNull: false
      },
      location: {
        type: Sequelize.TEXT,
        allowNull: false
      },
      observers: {
        type: Sequelize.TEXT,
        allowNull: false
      },
      rainBg: {
        type: Sequelize.TEXT
      },
      rainEn: {
        type: Sequelize.TEXT
      },
      temperature: {
        type: Sequelize.FLOAT
      },
      windDirectionBg: {
        type: Sequelize.TEXT
      },
      windDirectionEn: {
        type: Sequelize.TEXT
      },
      windSpeedBg: {
        type: Sequelize.TEXT
      },
      windSpeedEn: {
        type: Sequelize.TEXT
      },
      cloudinessBg: {
        type: Sequelize.TEXT
      },
      cloudinessEn: {
        type: Sequelize.TEXT
      },
      cloudsType: {
        type: Sequelize.TEXT
      },
      visibility: {
        type: Sequelize.FLOAT
      },
      mto: {
        type: Sequelize.TEXT
      },
      notes: {
        type: Sequelize.TEXT
      },
      threatsBg: {
        type: Sequelize.TEXT
      },
      threatsEn: {
        type: Sequelize.TEXT
      },
      
      //Internal
      userId: {
        type: Sequelize.INTEGER,
        allowNull: false
      },
      createdAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      updatedAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      imported: {
        type: Sequelize.INTEGER
      }
    }).then(function () {
      return queryInterface.addIndex(tableName, {
          fields: ['userId']
        })
        .then(function () {
          return queryInterface.addIndex(tableName, {
            fields: ['startDateTime']
          });
        })
        .then(function(){
          return queryInterface.addIndex(tableName, {
            fields: ['observationDateTime']
          });
        })
        .then(function () {
          return queryInterface.addIndex(tableName, {
            fields: ['species']
          });
        })
        .catch(function () {
        })
    });
  },

  down: function (queryInterface, Sequelize) {
    return queryInterface.dropTable(tableName);
  }
}
;
{'fraction_non_alphanumeric': 0.10596241088788075, 'fraction_numerical': 0.0009721322099805574, 'mean_word_length': 1.5561076604554867, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3103045', 'n_tokens_mistral': 1848, 'n_tokens_neox': 1828, 'n_words': 364}