<commit_before>--
-- This Source Code Form is subject to the terms of the Mozilla Public
-- License, v. 2.0. If a copy of the MPL was not distributed with this
-- file, You can obtain one at http://mozilla.org/MPL/2.0/.
--

----------------------------------------------------------
-- SQL SCRIPT TO CREATE DATABASE IN A DERBY ENVIRONMENT --
----------------------------------------------------------


------------------
-- TABLE CONFIG --
------------------

CREATE TABLE "APP"."CONFIG" (
  ID varchar(32) CONSTRAINT CONFIG_PK PRIMARY KEY NOT NULL,
  CONFIGVALUE varchar(128)
);
--
-- Database schema version. As config values are all strings, and for simplicity,
-- we deal with this value as a string in three chunks separated by dots:
--
-- The first chunk should match major versions of the application, parsed as an integer
-- The second chunk should match minor versions of the application, parsed as an integer
-- The third chunk may be used during development to trigger new updates of the
--     schema without changing the app version, parsed as a string like "a1" for alpha
--     versions, "b2" for beta versions, or "r5" for release maintenance version
INSERT INTO APP.CONFIG (ID, "VALUE")
	VALUES ('DB_VERSION', '0.0.a1')
;


--------------------
-- TABLE COUNTERS --
--------------------

CREATE TABLE "APP"."COUNTERS" (
  ENTITY varchar(32) CONSTRAINT COUNTERS_PK PRIMARY KEY NOT NULL,
  VALUE int
)
;
INSERT INTO APP.COUNTERS (ENTITY, "VALUE") 
	VALUES ('L10N', 0)
;
INSERT INTO APP.COUNTERS (ENTITY, "VALUE") 
	VALUES ('GLOSSARY', 0)
;

INSERT INTO APP.COUNTERS (ENTITY, "VALUE")
	VALUES ('GLSENTRY', 0)
;

INSERT INTO APP.COUNTERS (ENTITY, "VALUE")
	VALUES ('GLSTRANSLATION', 0)
;

----------------
-- TABLE L10N --
----------------

CREATE TABLE "APP"."L10N"
(
   ID int CONSTRAINT L10N_PK PRIMARY KEY NOT NULL,
   L10NCODE varchar(10) NOT NULL,
   L10NNAME varchar(80),<commit_msg>I shouldn't have done this (update the 0.0.a1 script when the DB is already at 0.0.a1). Anyway, some tables were using SQL reserved words as column names, so I'd rather rename them.<commit_after>--
-- This Source Code Form is subject to the terms of the Mozilla Public
-- License, v. 2.0. If a copy of the MPL was not distributed with this
-- file, You can obtain one at http://mozilla.org/MPL/2.0/.
--

----------------------------------------------------------
-- SQL SCRIPT TO CREATE DATABASE IN A DERBY ENVIRONMENT --
----------------------------------------------------------


------------------
-- TABLE CONFIG --
------------------

CREATE TABLE "APP"."CONFIG" (
  ID varchar(32) CONSTRAINT CONFIG_PK PRIMARY KEY NOT NULL,
  CONFIGVALUE varchar(128)
);
--
-- Database schema version. As config values are all strings, and for simplicity,
-- we deal with this value as a string in three chunks separated by dots:
--
-- The first chunk should match major versions of the application, parsed as an integer
-- The second chunk should match minor versions of the application, parsed as an integer
-- The third chunk may be used during development to trigger new updates of the
--     schema without changing the app version, parsed as a string like "a1" for alpha
--     versions, "b2" for beta versions, or "r5" for release maintenance version
INSERT INTO APP.CONFIG (ID, CONFIGVALUE)
	VALUES ('DB_VERSION', '0.0.a1')
;


--------------------
-- TABLE COUNTERS --
--------------------

CREATE TABLE "APP"."COUNTERS" (
  ENTITY varchar(32) CONSTRAINT COUNTERS_PK PRIMARY KEY NOT NULL,
  COUNTERVALUE int
)
;
INSERT INTO APP.COUNTERS (ENTITY, COUNTERVALUE)
	VALUES ('L10N', 0)
;
INSERT INTO APP.COUNTERS (ENTITY, COUNTERVALUE)
	VALUES ('GLOSSARY', 0)
;

INSERT INTO APP.COUNTERS (ENTITY, COUNTERVALUE)
	VALUES ('GLSENTRY', 0)
;

INSERT INTO APP.COUNTERS (ENTITY, COUNTERVALUE)
	VALUES ('GLSTRANSLATION', 0)
;

----------------
-- TABLE L10N --
----------------

CREATE TABLE "APP"."L10N"
(
   ID int CONSTRAINT L10N_PK PRIMARY KEY NOT NULL,
   L10NCODE varchar(10) NOT NULL,
   L10NNAME varchar(80),
{'fraction_non_alphanumeric': 0.20074906367041198, 'fraction_numerical': 0.019975031210986267, 'mean_word_length': 2.2516233766233764, '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': '2395491', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1150, 'n_words': 482}