<commit_before>"use strict";

const sql = require('sql');
const Table = require('../table');
const Registry = require('../../../util/registry');
const {coroutine: co, promisify} = require('bluebird');

class Attribute extends Table {
  constructor(engine, relationship, name, alias=null) {
    super(engine, relationship.name + '_' + name, alias);
    this.id = name;
    this.relationship = relationship;
    this.attributeRegistry = new Registry();
    return this;
  }

  schema() {
    let schema = super.schema();
    schema.columns.push({
      name: 'parentId',
      dataType: 'INTEGER',
      notNull: true,
    }, {
      name: 'revisionIdFrom',
      dataType: 'INTEGER',
      notNull: true,
    }, {
      name: 'revisionIdTo',
      dataType: 'INTEGER',
      notNull: false,
    }, {
      name: 'weight',
      dataType: 'REAL',
      notNull: true,
    });<commit_msg>Attributes should add themselves to Orm.entityRegistry<commit_after>"use strict";

const sql = require('sql');
const Table = require('../table');
const Registry = require('../../../util/registry');
const {coroutine: co, promisify} = require('bluebird');

class Attribute extends Table {
  constructor(engine, relationship, name, alias=null) {
    super(engine, relationship.name + '_' + name, alias);
    this.relationship = relationship;
    this.attributeRegistry = new Registry();
    engine.pluginRegistry.get('Orm').entityRegistry.set(this);
    return this;
  }

  schema() {
    let schema = super.schema();
    schema.columns.push({
      name: 'parentId',
      dataType: 'INTEGER',
      notNull: true,
    }, {
      name: 'revisionIdFrom',
      dataType: 'INTEGER',
      notNull: true,
    }, {
      name: 'revisionIdTo',
      dataType: 'INTEGER',
      notNull: false,
    }, {
      name: 'weight',
      dataType: 'REAL',
      notNull: true,
    });
{'fraction_non_alphanumeric': 0.15803667745415317, 'fraction_numerical': 0.0, 'mean_word_length': 2.930084745762712, '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': '3383062', 'n_tokens_mistral': 565, 'n_tokens_neox': 558, 'n_words': 136}