Skip to content

Commit

Permalink
fix: add DB level cascade drop to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
smotornyuk committed Oct 6, 2023
1 parent 2464bb8 commit e68e55c
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 13 deletions.
91 changes: 78 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,100 @@
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
All notable changes to this project will be documented in this file.

## [0.2.0](https://github.com/DataShades/ckanext-comments/compare/v0.1.2...v0.2.0) (2023-04-03)
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- insertion marker -->
## [v0.3.0](https://github.com/DataShades/ckanext-comments/releases/tag/v0.3.0) - 2023-04-11

### ⚠ BREAKING CHANGES

* replace const module with config
<small>[Compare with v0.1.2](https://github.com/DataShades/ckanext-comments/compare/v0.1.2...v0.3.0)</small>

### Features

* replace const module with config ([6fe009b](https://github.com/DataShades/ckanext-comments/commit/6fe009be3510bcaa06d6bb5b14fc888896a5d517))
- replace const module with config ([6fe009b](https://github.com/DataShades/ckanext-comments/commit/6fe009be3510bcaa06d6bb5b14fc888896a5d517) by Sergey Motornyuk).

### Bug Fixes

- resolve circular import of Thread from Comment ([9054878](https://github.com/DataShades/ckanext-comments/commit/905487830017cc13bcbab4d27ce448bcc705c16c) by Sergey Motornyuk).

## [v0.1.2](https://github.com/DataShades/ckanext-comments/releases/tag/v0.1.2) - 2023-03-03

<small>[Compare with v0.1.0](https://github.com/DataShades/ckanext-comments/compare/v0.1.0...v0.1.2)</small>

### Bug Fixes

* resolve circular import of Thread from Comment ([9054878](https://github.com/DataShades/ckanext-comments/commit/905487830017cc13bcbab4d27ce448bcc705c16c))
- add config declaration to manifest ([247df40](https://github.com/DataShades/ckanext-comments/commit/247df40982a2319b58cae902624c3f576fb87042) by Sergey Motornyuk).

### [0.1.2](https://github.com/DataShades/ckanext-comments/compare/v0.1.0...v0.1.2) (2023-03-03)
## [v0.1.0](https://github.com/DataShades/ckanext-comments/releases/tag/v0.1.0) - 2022-11-09

<small>[Compare with v0.0.19](https://github.com/DataShades/ckanext-comments/compare/v0.0.19...v0.1.0)</small>

### Bug Fixes

* add config declaration to manifest ([247df40](https://github.com/DataShades/ckanext-comments/commit/247df40982a2319b58cae902624c3f576fb87042))
- allow editing own draft comments by default ([fe83008](https://github.com/DataShades/ckanext-comments/commit/fe830083d80a0d494cb021ef42f9432b86dc811a) by Sergey Motornyuk).

### [0.1.1](https://github.com/DataShades/ckanext-comments/compare/v0.1.0...v0.1.1) (2023-03-01)
## [v0.0.19](https://github.com/DataShades/ckanext-comments/releases/tag/v0.0.19) - 2022-04-12

## [0.1.0](https://github.com/DataShades/ckanext-comments/compare/v0.0.19...v0.1.0) (2022-11-09)
<small>[Compare with v0.0.18](https://github.com/DataShades/ckanext-comments/compare/v0.0.18...v0.0.19)</small>

## [v0.0.18](https://github.com/DataShades/ckanext-comments/releases/tag/v0.0.18) - 2022-03-31

### Bug Fixes
<small>[Compare with v0.0.17](https://github.com/DataShades/ckanext-comments/compare/v0.0.17...v0.0.18)</small>

## [v0.0.17](https://github.com/DataShades/ckanext-comments/releases/tag/v0.0.17) - 2022-03-29

<small>[Compare with v0.0.16](https://github.com/DataShades/ckanext-comments/compare/v0.0.16...v0.0.17)</small>

## [v0.0.16](https://github.com/DataShades/ckanext-comments/releases/tag/v0.0.16) - 2021-12-10

<small>[Compare with v0.0.15](https://github.com/DataShades/ckanext-comments/compare/v0.0.15...v0.0.16)</small>

## [v0.0.15](https://github.com/DataShades/ckanext-comments/releases/tag/v0.0.15) - 2021-12-10

<small>[Compare with v0.0.13](https://github.com/DataShades/ckanext-comments/compare/v0.0.13...v0.0.15)</small>

## [v0.0.13](https://github.com/DataShades/ckanext-comments/releases/tag/v0.0.13) - 2021-12-09

<small>[Compare with v0.0.12](https://github.com/DataShades/ckanext-comments/compare/v0.0.12...v0.0.13)</small>

## [v0.0.12](https://github.com/DataShades/ckanext-comments/releases/tag/v0.0.12) - 2021-12-09

<small>[Compare with v0.0.11](https://github.com/DataShades/ckanext-comments/compare/v0.0.11...v0.0.12)</small>

## [v0.0.11](https://github.com/DataShades/ckanext-comments/releases/tag/v0.0.11) - 2021-12-08

<small>[Compare with v0.0.10](https://github.com/DataShades/ckanext-comments/compare/v0.0.10...v0.0.11)</small>

## [v0.0.10](https://github.com/DataShades/ckanext-comments/releases/tag/v0.0.10) - 2021-10-29

<small>[Compare with v0.0.9](https://github.com/DataShades/ckanext-comments/compare/v0.0.9...v0.0.10)</small>

## [v0.0.9](https://github.com/DataShades/ckanext-comments/releases/tag/v0.0.9) - 2021-05-17

<small>[Compare with v0.0.8](https://github.com/DataShades/ckanext-comments/compare/v0.0.8...v0.0.9)</small>

## [v0.0.8](https://github.com/DataShades/ckanext-comments/releases/tag/v0.0.8) - 2021-04-26

<small>[Compare with v0.0.6](https://github.com/DataShades/ckanext-comments/compare/v0.0.6...v0.0.8)</small>

## [v0.0.6](https://github.com/DataShades/ckanext-comments/releases/tag/v0.0.6) - 2021-03-31

<small>[Compare with v0.0.5](https://github.com/DataShades/ckanext-comments/compare/v0.0.5...v0.0.6)</small>

## [v0.0.5](https://github.com/DataShades/ckanext-comments/releases/tag/v0.0.5) - 2021-03-29

<small>[Compare with v0.0.4](https://github.com/DataShades/ckanext-comments/compare/v0.0.4...v0.0.5)</small>

## [v0.0.4](https://github.com/DataShades/ckanext-comments/releases/tag/v0.0.4) - 2021-03-26

<small>[Compare with v0.0.3](https://github.com/DataShades/ckanext-comments/compare/v0.0.3...v0.0.4)</small>

## [v0.0.3](https://github.com/DataShades/ckanext-comments/releases/tag/v0.0.3) - 2021-03-26

<small>[Compare with v0.0.2](https://github.com/DataShades/ckanext-comments/compare/v0.0.2...v0.0.3)</small>

## [v0.0.2](https://github.com/DataShades/ckanext-comments/releases/tag/v0.0.2) - 2021-03-25

<small>[Compare with first commit](https://github.com/DataShades/ckanext-comments/compare/0bc74fb042ef7af60b0e900e50cfc6c15a94fb18...v0.0.2)</small>

* allow editing own draft comments by default ([fe83008](https://github.com/DataShades/ckanext-comments/commit/fe830083d80a0d494cb021ef42f9432b86dc811a))
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.DEFAULT_GOAL := help
.PHONY = help

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'


changelog: ## compile changelog
git changelog -c conventional -o CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""add cascade to comments
Revision ID: 910f3d575038
Revises: 275515c51af1
Create Date: 2023-10-06 22:54:18.933232
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "910f3d575038"
down_revision = "275515c51af1"
branch_labels = None
depends_on = None


def upgrade():
op.drop_constraint("comments_comments_thread_id_fkey", "comments_comments")
op.drop_constraint("comments_comments_reply_to_id_fkey", "comments_comments")

op.create_foreign_key(
"comments_comments_thread_id_fkey",
"comments_comments",
"comments_threads",
["thread_id"],
["id"],
ondelete="CASCADE",
)
op.create_foreign_key(
"comments_comments_reply_to_id_fkey",
"comments_comments",
"comments_comments",
["reply_to_id"],
["id"],
ondelete="CASCADE",
)


def downgrade():
pass

0 comments on commit e68e55c

Please sign in to comment.