Files
replypier/backend/alembic/versions/drop_slack_tables_001.py
T
WangShen007 54b949b392 chore(brand): rename the product to ReplyPier
The upstream project name is gone from code, assets, docs and build
output: brand strings, domains (replypier.site and its app/api/docs/help
subdomains), env prefixes, image and network names, the widget's public
JS API (window.ReplyPier, replypierId/BaseUrl/Config/Token), CSS tokens
(--rp-*), file and directory names, and the WordPress plugin package.

- widget loader is now webclient/replypier.min.js; both bundles rebuilt
  from source (backend/assets/widget.{js,css}, frontend/public/webclient)
- NOTICE, llms.txt, CONTRIBUTING, HELP_CENTER_INFRA and config.dev.js
  rewritten rather than string-swapped; the demo config no longer ships
  the previous vendor's Firebase/Razorpay/Google keys
- new migration replypier_ai_model_001 adds REPLYPIER to the managed
  AIModelType and rewrites pre-rename rows
- local compose project, database, role and volume renamed; LOCAL_DEPLOY
  documents carrying the old local data over
2026-10-26 00:51:03 +08:00

61 lines
2.2 KiB
Python

"""
Copyright 2024-2026 ReplyPier
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
"""Drop legacy Slack tables — Slack now runs on the unified channel stack
Revision ID: drop_slack_tables_001
Revises: add_channel_tables_001
Create Date: 2026-07-10 22:00:00.000000
The old integration (slack_tokens with plaintext tokens, per-thread
slack_conversations, per-channel agent_slack_configs, workspace storage modes)
is replaced by channel_accounts / channel_conversations / agent_channel_configs.
The old integration had no production users, so no data is migrated. Downgrade
recreates empty tables via the original add_slack_integration_001 shapes.
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = 'drop_slack_tables_001'
down_revision: Union[str, None] = 'add_channel_tables_001'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
_TABLES = ('slack_conversations', 'agent_slack_configs', 'slack_workspace_configs', 'slack_tokens')
def upgrade() -> None:
for table in _TABLES:
op.execute(f'DROP TABLE IF EXISTS {table} CASCADE')
op.execute('DROP TYPE IF EXISTS storagemode')
def downgrade() -> None:
# Recreate empty legacy tables by re-running the original migration's DDL.
# Version scripts aren't importable by module name — load by file path.
import importlib.util
import os
legacy_path = os.path.join(os.path.dirname(__file__), 'add_slack_integration_001.py')
spec = importlib.util.spec_from_file_location('add_slack_integration_001', legacy_path)
legacy = importlib.util.module_from_spec(spec)
spec.loader.exec_module(legacy)
legacy.upgrade()