<commit_before><?php

use yii\db\Migration;

/**
 * Class m270120_100001_init_web_notification_subscriptions
 */
class m270120_100001_init_web_notification_subscriptions extends Migration
{
    /**
     * Create table `web_push_subscription`
     */
    public function up()
    {
        $tableOptions = null;

        if ($this->db->driverName === 'mysql') {
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
        }

        // notifications
        $this->createTable('{{%web_push_subscription}}', [
            'id' => $this->primaryKey(),
            'subscription' => $this->text()->notNull(),
            'endpoint' => $this->text()->notNull(),
            'user_id' => $this->integer(11)->unsigned()->notNull()->defaultValue(0),
            'created_at' => $this->timestamp()->null()->defaultExpression('CURRENT_TIMESTAMP'),
            'updated_at' => $this->timestamp()->defaultValue(null)->append('ON UPDATE CURRENT_TIMESTAMP'),
        ], $tableOptions);
        $this->createIndex('index_2', '{{%web_push_subscription}}', ['user_id']);
        $this->createIndex('index_3', '{{%web_push_subscription}}', ['created_at']);
        $this->createIndex('index_4', '{{%web_push_subscription}}', ['seen']);

    }

    /**
     * Drop table `web_push_subscription`
     */
    public function down()
    {
        $this->dropTable('{{%web_push_subscription}}');
    }
}<commit_msg>add migration and fix models<commit_after><?php

use yii\db\Migration;

/**
 * Class m270120_100001_init_web_notification_subscriptions
 */
class m270120_100001_init_web_notification_subscriptions extends Migration
{
    /**
     * Create table `web_push_subscription`
     */
    public function up()
    {
        $tableOptions = null;

        if ($this->db->driverName === 'mysql') {
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
        }

        // notifications
        $this->createTable('{{%web_push_subscription}}', [
            'id' => $this->primaryKey(),
            'subscription' => $this->text()->notNull(),
            'endpoint' => $this->text()->notNull(),
            'user_id' => $this->integer(11)->unsigned()->notNull()->defaultValue(0),
            'created_at' => $this->timestamp()->null()->defaultExpression('CURRENT_TIMESTAMP'),
            'updated_at' => $this->timestamp()->defaultValue(null)->append('ON UPDATE CURRENT_TIMESTAMP'),
        ], $tableOptions);
        $this->createIndex('index_2', '{{%web_push_subscription}}', ['user_id']);
        $this->createIndex('index_4', '{{%web_push_subscription}}', ['endpoint']);

    }

    /**
     * Drop table `web_push_subscription`
     */
    public function down()
    {
        $this->dropTable('{{%web_push_subscription}}');
    }
}
{'fraction_non_alphanumeric': 0.17813620071684588, 'fraction_numerical': 0.02258064516129032, 'mean_word_length': 3.0983847283406756, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 58, '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': '4669790', 'n_tokens_mistral': 880, 'n_tokens_neox': 845, 'n_words': 121}