<commit_before><?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>

<xsl:template match="/">
  <xsl:apply-templates select="tables/table" mode="drop"/>
  <xsl:apply-templates select="tables/table" mode="create"/>
</xsl:template>

<xsl:template match="table" mode="drop">
<statement type="drop">
DROP TABLE <xsl:value-of select="name"/><xsl:text>
</xsl:text>
</statement><xsl:text>
</xsl:text>
</xsl:template>

<xsl:template match="table" mode="create">
<statement type="create">
CREATE TABLE <xsl:value-of select="name"/>
(
<xsl:apply-templates select="columns/column"/>
<xsl:apply-templates select="primary-key"/>
)
</statement><xsl:text>
</xsl:text>
</xsl:template>

<xsl:template match="column">
  <xsl:text>  </xsl:text>
  <xsl:value-of select="name"/>
  <xsl:text> </xsl:text>
  <xsl:value-of select="type"/>
  <xsl:if test="param">(<xsl:value-of select="param"/>)</xsl:if>
  <xsl:if test="../../primary-key = node()"> NOT NULL</xsl:if>
    <xsl:if test="position() != last() or ../../primary-key"><xsl:text>,
</xsl:text></xsl:if>
</xsl:template>
<commit_msg>Add not-null attribute to a column if asked for<commit_after><?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>

<xsl:template match="/">
  <xsl:apply-templates select="tables/table" mode="drop"/>
  <xsl:apply-templates select="tables/table" mode="create"/>
</xsl:template>

<xsl:template match="table" mode="drop">
<statement type="drop">
DROP TABLE <xsl:value-of select="name"/><xsl:text>
</xsl:text>
</statement><xsl:text>
</xsl:text>
</xsl:template>

<xsl:template match="table" mode="create">
<statement type="create">
CREATE TABLE <xsl:value-of select="name"/>
(
<xsl:apply-templates select="columns/column"/>
<xsl:apply-templates select="primary-key"/>
)
</statement><xsl:text>
</xsl:text>
</xsl:template>

<xsl:template match="column">
  <xsl:text>  </xsl:text>
  <xsl:value-of select="name"/>
  <xsl:text> </xsl:text>
  <xsl:value-of select="type"/>
  <xsl:if test="param">(<xsl:value-of select="param"/>)</xsl:if>
  <xsl:if test="../../not-null = node() or ../../primary-key = node()"> NOT NULL</xsl:if>
    <xsl:if test="position() != last() or ../../primary-key"><xsl:text>,
</xsl:text></xsl:if>
</xsl:template>

{'fraction_non_alphanumeric': 0.245411865130175, 'fraction_numerical': 0.0076824583866837385, 'mean_word_length': 5.833819241982507, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 2, '>': 87, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, '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': '2652446', 'n_tokens_mistral': 914, 'n_tokens_neox': 824, 'n_words': 151}