<commit_before>--
-- This is a Media Cloud PostgreSQL schema difference file (a "diff") between schema
-- versions 4389 and 4390.
--
-- If you are running Media Cloud with a database that was set up with a schema version
-- 4389, and you would like to upgrade both the Media Cloud and the
-- database to be at version 4390, import this SQL file:
--
--     psql mediacloud < mediawords-4389-4390.sql
--
-- You might need to import some additional schema diff files to reach the desired version.
--

--
-- 1 of 2. Import the output of 'apgdiff':
--

-- no-op

--
-- 2 of 2. Reset the database version.
--
SELECT set_database_schema_version();

<commit_msg>set schema version correctly in one of the diffs<commit_after>--
-- This is a Media Cloud PostgreSQL schema difference file (a "diff") between schema
-- versions 4389 and 4390.
--
-- If you are running Media Cloud with a database that was set up with a schema version
-- 4389, and you would like to upgrade both the Media Cloud and the
-- database to be at version 4390, import this SQL file:
--
--     psql mediacloud < mediawords-4389-4390.sql
--
-- You might need to import some additional schema diff files to reach the desired version.
--

--
-- 1 of 2. Import the output of 'apgdiff':
--

CREATE OR REPLACE FUNCTION set_database_schema_version() RETURNS boolean AS $$
DECLARE
    
    -- Database schema version number (same as a SVN revision number)
    -- Increase it by 1 if you make major database schema changes; for example, if you're currently at
    -- SVN revision 4379, set it to 4380 (which would be the future SVN revision when committed)
    MEDIACLOUD_DATABASE_SCHEMA_VERSION CONSTANT INT := 4390;
    
BEGIN

    -- Update / set database schema version
    DELETE FROM database_variables WHERE name = 'database-schema-version';
    INSERT INTO database_variables (name, value) VALUES ('database-schema-version', MEDIACLOUD_DATABASE_SCHEMA_VERSION::int);

    return true;
    
END;
$$
LANGUAGE 'plpgsql';

--
-- 2 of 2. Reset the database version.
--
SELECT set_database_schema_version();


{'fraction_non_alphanumeric': 0.0847457627118644, 'fraction_numerical': 0.03341404358353511, 'mean_word_length': 3.1991869918699187, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6705755', 'n_tokens_mistral': 652, 'n_tokens_neox': 587, 'n_words': 276}